Back
What is the correct way to declare a boolean variable in Java?
Use boolean instead of Boolean
Assign during declaration:
Boolean isMatch = email1.equals(email2);
Use final keyword if you can:
final boolean isMatch = email1.equals(email2);
Last but not least:if(isMatch==true)
Can be expressed as:
if(isMatch)
31k questions
32.8k answers
501 comments
693 users