Lets say I have class foo
in which I have a Boolean
(not boolean
) variable bar
:
class foo {
Boolean bar;
Boolean isBar(){
return bar;
}
boolean isBar(){
return bar.booleanValue();
}
}
Which of the above methods is the right way in Java.
I know both will work but I want to know what is the coding convention in Java regarding this matter?