Page 1 of 1

Error on OCP 1Z0-815 BOOK Deshmukh, Hanumant Page 121

Posted: Mon Feb 10, 2020 12:10 pm
by javiut
In the line which states.
//Comparing a int with a Double prints false because a and d have the same value.

But should be prints true i think is a mistype.

Because in fact this is returning true.

Code: Select all

        final int intValue = 10;
        final Double doubleValue = 10.0;
        System.out.println(intValue==doubleValue);
:joy:

Re: Error on OCP 1Z0-815 BOOK Deshmukh, Hanumant Page 121

Posted: Mon Feb 10, 2020 10:57 pm
by admin
On that line the comparison is a != d. That is why it will print false.