Android : Methods vs Method assigned to variables in Java

on Sunday, July 6, 2014


I'm sort of confused, I guess this question is just a matter of preference, I just want to understand the difference of the following code.



if (IsRegistered() == true) ...

public boolean IsRegistered()
{
private boolean status = false;
// blah blah code here
return status;
}


vs



isRegistered = IsRegistered();
if (isRegistered)


I know both would work, I'm not being pedantic but I just want to understand so I would know my way around.


0 comments:

Post a Comment