Java Boolean compare() methodThe compare() method of Java Boolean class compares the two Boolean values (x and y) and returns an integer value based on the result of this method. Syntax:Parameters:Here, x(first boolean) and y( second boolean) are two boolean parameters passed which are compared. Return Value:This method returns an integer value.
Example 1Test it NowOutput: b1 value is true Example 2Output: Enter two no.s I no :89 II no :98 98 is greater Example 3Output: Enter your percentage: 74.9999 Sorry! Your percentage is lower than our requirement. Next TopicJava Boolean |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India