Which one is better Java coding style?
boolean status = true; if (!status) { //do sth } else { //do sth }
or:
if (status == false) { //do sth } else { //do sth }
I would suggest that you do:
if (status) { //positive work } else { // negative work }
The == tests, while obviously redundant, also run the risk of a single = typo which would result in an assignment.
==
=
1.4m articles
1.4m replys
5 comments
56.9k users