[HD Pg 212, Sec. 8.5.3 - invoking-a-constructor]

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

Moderator: admin

Post Reply
OCAJO1
Posts: 221
Joined: Mon Nov 26, 2018 2:43 pm
Contact:

[HD Pg 212, Sec. 8.5.3 - invoking-a-constructor]

Post by OCAJO1 »

If the following was introduced as LINE E in the example,

System.out.println(new Account().id+", "+new Account().name);

Is it correct to say that although it will print 111 and "dummy", the 111 and "dummy" are printed from two different Account objects?

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

Re: [HD Pg 212, Sec. 8.5.3 - invoking-a-constructor]

Post by admin »

Yes, that would be correct.

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 5 guests