Menu
Question Index
...

Write a program to find two numbers are equals or not.

Input (Double number1, Double number2) Output
18.23
18.23
true
-23.45
-23.45
true
0.9800
0.98
true
56.78
57.23
false
56.78
null
false
null
12.34
false
null
null
false



class EqualsTwoNumbers
{
    public static void main(String s[])
    {
        Double number1 = 0.4500;
        Double number2 = 0.45;
        System.out.println("The two numbers "+number1 + " and " + number2+" are equals "+equalsDouble(number1, number2));

    }


        public static boolean equalsDouble(Double number1, Double number2)
        {
            boolean result = false;
            return result;
        }

}

Doubts

Problems

Topic: Java Double Class And Java Float Class

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App