About Question enthuware.ocajp.i.v7.2.1001 :

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

Moderator: admin

Post Reply
ETS User

About Question enthuware.ocajp.i.v7.2.1001 :

Post by ETS User »

I can still make id static and provide a static getId, that would still make the variable read only.
Am I right?

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

Re: About Question enthuware.ocajp.i.v7.2.1001 :

Post by admin »

Making it static will not affect its visibility. Other classes can still access it directly. To hide it from other classes, you have to make it private.

HTH,
Paul.
If you like our products and services, please help us by posting your review here.

Post Reply

Who is online

Users browsing this forum: No registered users and 209 guests