Java Float equals() methodThe equals() method of Float class returns a Boolean value corresponding to this Float Object by simply comparing the Float object with the given float object method argument. Syntax:Parameters:The parameter obj is passed which is an object compared with other object. Return Value:This method returns the Boolean value of the argument.
Example 1Test it NowOutput: Enter password 20.09 Password matched Example 2Test it NowOutput: Enter marks in Maths 98 Enter marks in English 90 Enter marks in Hindi 90 Your CGPA is 9.0 Congratulation! You passed with A+ grade Example 3Test it NowOutput: If there are 4 apples.You take away 2 apples.How many do you have in hands? 1. 1 apple 2. 2 apples 3. 3apple Enter your option. 2 Right answer!
Next TopicJava Float
|