Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #39103

Why i++ can not be used in conditional operator?

Path csiph.com!aioe.org!.POSTED.tnWQOhh9aKe1CDqJB+8Pmw.user.gioia.aioe.org!not-for-mail
From Xue Feng <xf.lotus@yahoo.com>
Newsgroups comp.lang.java.programmer
Subject Why i++ can not be used in conditional operator?
Date Fri, 16 Aug 2019 11:01:28 +0800
Organization Aioe.org NNTP Server
Lines 6
Message-ID <qj56aa$6jg$1@gioia.aioe.org> (permalink)
NNTP-Posting-Host tnWQOhh9aKe1CDqJB+8Pmw.user.gioia.aioe.org
Mime-Version 1.0
Content-Type text/plain; charset=gbk; format=flowed
Content-Transfer-Encoding 7bit
X-Complaints-To abuse@aioe.org
User-Agent Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:60.0) Gecko/20100101 Thunderbird/60.8.0
X-Notice Filtered by postfilter v. 0.9.2
X-Mozilla-News-Host news://nntp.aieo.org:119
Xref csiph.com comp.lang.java.programmer:39103

Show key headers only | View raw


Hi all,
   In C, the expression 'inc ? i++ : i--' is vaild, and can be accepted 
by compiler. But in Java the same expression will cause the compiler to 
issue errors. I wonder the 'i++' (or 'i--') is rather a statement than 
an expression, as such can not return a value. Is that true?

Back to comp.lang.java.programmer | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

Why i++ can not be used in conditional operator? Xue Feng <xf.lotus@yahoo.com> - 2019-08-16 11:01 +0800
  Re: Why i++ can not be used in conditional operator? Marcel Mueller <news.5.maazl@spamgourmet.org> - 2019-08-16 09:45 +0200
    Re: Why i++ can not be used in conditional operator? taqmcg@gmail.com - 2019-08-20 11:03 -0700

csiph-web