[Solved] if-else statement does not execute in Java [duplicate]


Use the right way to compare string because you are comparing memory location of the String

problem

if(gender == "m") //compares memory location of the String will return always false

solution

if(gender.equals("m")) 

3

solved if-else statement does not execute in Java [duplicate]