pls give reason why this java program always comes to the else part

Posted by Anbu on Stack Overflow See other posts from Stack Overflow or by Anbu
Published on 2010-06-12T23:42:45Z Indexed on 2010/06/12 23:52 UTC
Read the original article Hit count: 127

Filed under:

public class Test { public static void main(String[] args){ if (5.0 > 5) // (5.0<5) for both case it is going to else System.out.println("5.0 is greater than 5"); else System.out.println("else part always comes here"); /another sample/ if (5.0 == 5) System.out.println("equals"); else System.out.println("not equal"); } }

can any one explain the first "if statement" why it always come to else part

© Stack Overflow or respective owner

Related posts about java