Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #39103
| From | Xue Feng <xf.lotus@yahoo.com> |
|---|---|
| Newsgroups | comp.lang.java.programmer |
| Subject | Why i++ can not be used in conditional operator? |
| Date | 2019-08-16 11:01 +0800 |
| Organization | Aioe.org NNTP Server |
| Message-ID | <qj56aa$6jg$1@gioia.aioe.org> (permalink) |
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
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