We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
|| is the Logical OR operator.
-> returns a boolean which is true if and only if both of its operands are true.
b = 3 > 2 || 5 < 7; // b is true
b = 2 > 3 || 5 < 7; // b is still true
b = 2 > 3 || 5 > 7; // now b is false
You should check out Java Operator and their Precedence
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Java Datatypes
You are viewing a single comment's thread. Return to all comments →
not op, but @rajujnvgupta
|| is the Logical OR operator. -> returns a boolean which is true if and only if both of its operands are true. b = 3 > 2 || 5 < 7; // b is true b = 2 > 3 || 5 < 7; // b is still true b = 2 > 3 || 5 > 7; // now b is false
You should check out Java Operator and their Precedence