(5<6 || 6<5) output true for what reason?

Why is the code bellow outputs true??? what are the || outputs in case of three expressions or more???

public class And {
	public static void main(String[] args) {


OR short-circuits on true. Because the first operand is true, the expression returns true.

AND, on the other hand short-circuits on false, so the above would be false.


Thanks, now it sounds realy simple

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.