What is this syntax called Bool bool = object.method() > 0 in Java

Posted by optician on Stack Overflow See other posts from Stack Overflow or by optician
Published on 2010-06-14T11:58:42Z Indexed on 2010/06/14 12:02 UTC
Read the original article Hit count: 286

Filed under:
|
|

I've just seen this line of code in my housemates code.

Bool bool = method() > 0;

or

string name = "Tony"; boolean nameIsTony = name == "Tony";

This would result in nameIsTony becoming true.

So you can have an inline conditional statement?

What is this called?

© Stack Overflow or respective owner

Related posts about java

Related posts about conditional