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

Help and support on OCA OCP Java Programmer Certification Questions
1Z0-808, 1Z0-809, 1Z0-815, 1Z0-816, 1Z0-817

Moderator: admin

Post Reply
javiut
Posts: 37
Joined: Fri Oct 19, 2012 10:48 am
Contact:

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

Post 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:

admin
Site Admin
Posts: 10398
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

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

Post by admin »

On that line the comparison is a != d. That is why it will print false.

Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests