Java Boolean booleanValue() methodThe booleanValue() method of Java Boolean class returns the primitive Boolean value of this Boolean object. Syntax:Parameters:NA Return Value:This method returns the primitive Boolean value of this Boolean object. Example 1Test it NowOutput: 1. Value of boolean object true is true. 2. Value of boolean object true is true. Example 2Output: Elements are: 0 1 2 3 4 5 Stop value is false Example 3Output: Enter two number I no:89 II no:90 90 is greater. Example 4Test it NowOutput: Error:(4, 24) java: boolean cannot be dereferenced The Boolean is a primitive data type. Its object can't be used to call the Boolean class method. If done, so it will give the above error. 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