Re: interpretation help of ?:
- From: "Rhino" <no.offline.contact.please@xxxxxxxxxx>
- Date: Wed, 26 Apr 2006 13:10:21 -0400
"Petterson Mikael" <mikael.petterson@xxxxxxxxxxxxxxx> wrote in message
news:444F2665.7010105@xxxxxxxxxxxxxxxxxx
Simon wrote:
Petterson Mikael wrote:
How shall i interpret the use of ?: operator in the code below?
Well, your code is slightly confusing since you have a nested usage of ?
and :
In general,
a = condition ? thenVal : elseVal;
is equivalent to
if (condition) {
a = thenVal;
} else {
a = elseVal;
}
In your code, thenVal is again an expression of this kind.
Cheers,
Simon
Thanks that helped :-)
It's called a "ternary expression" if you want to Google for more
information or examples.
--
Rhino
.
- References:
- interpretation help of ?:
- From: Petterson Mikael
- Re: interpretation help of ?:
- From: Simon
- Re: interpretation help of ?:
- From: Petterson Mikael
- interpretation help of ?:
- Prev by Date: Re: JavaHelp source files
- Next by Date: Re: Cannot resolve symbol - Netbeans 4.0
- Previous by thread: Re: interpretation help of ?:
- Next by thread: Re: interpretation help of ?:
- Index(es):