Java Double equals() methodThe equals() method of Java Double class compares this Double object against the specified Double object. The method returns true, if the argument is not null. Assuming d1 and d2 are the two instances of class Double, the value of d1.equals(d2) will be true if Also returns the value true. Overrides:The equals() method of class Double overrides the equals() method in class Object. SyntaxParametersobj - this is the object to compare with. Return valueThe equals() method will return true if objects are same, otherwise returns false. Example 1Output: Enter your bank accountNo. 12345.89 Your accountNo has matched.Now you can proceed with your transaction Example 2Output: Q. If an ant has 4 legs.How many legs do 8 ants will have ? 1.8 Legs 2.32 legs 3.65legs Enter your option 2 Your answer is correct! Example 3Output: Enter your name. Himanshu Enter your old password. 768.90 Enter your new password panda@123 Himanshu your password has successfully changed to panda@123 Next TopicJava-double-floatvalue-method |
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