Reputation: 37
Sorry if this question is too bare bones, but simply put, what is the correct way to do this:
OtherClass ClassObj = new OtherClass();
if(ClassObj.booleanMethod().equals(true)){
do a thing
}
I know this is a basic logical error and misconception, I just haven't been able to find the answer so far.
Upvotes: 0
Views: 1041
Reputation: 1005
You have to use
if(classObj.booleanMethod()){
do a thing if its true
}else{
do a thing if its false
}
Upvotes: 1