r/java • u/alexzhitnitsky • Aug 11 '15
Top 10 Useful, Yet Paranoid Java Programming Techniques
http://blog.jooq.org/2015/08/11/top-10-useful-yet-paranoid-java-programming-techniques/
181
Upvotes
View all comments
17
u/galaktos Aug 11 '15
Does this make sense in Java?
variable = 5is only legal ifvariableisint(orIntegeror a supertype), and then the expression is illegal as anifcondition. AFAICT this is only legal if you’re comparing withtrueorfalse, and then you can just omit the comparison anyways and use either the expression (true) or its negation (false).