I have seen some question in Java (question 15 here), printing the value of f
gives value as false
boolean f = false,b;
System.out.println(f); // prints false
But using two numeric values gives an error: int x= 5,1; System.out.println(x);
Reversing the assignment also gave me an error
boolean x = b,true;
A.java:7: error: <identifier> expected
but boolean x = true,b;
prints value of x
is true!
Can some one explain how the code works?