Question about access modifiers

Oracle Certified Foundations Associate Java Certification Questions and Discussion
1Z0-811

Moderator: admin

Post Reply
aks0961
Posts: 12
Joined: Sun May 28, 2023 1:17 pm
Contact:

Question about access modifiers

Post by aks0961 »

Hi, I have a question pertaining to access modifiers that I was hoping to get rectified.

On page 203, in section 10.2.2, which talks about the access modifiers, it is explicitly stated that there are three access modifiers: private, protected, and public. Its also mentioned that if a variable doesnt have either of these three, that initself is an indication of a modifier known as default.

On the next page, it is stated under the exam tip that we should be wary of the test tricking us by using non existent modifiers such as "default"

So does this mean that even though the absence of private, protected, and/or public conceptually indicates a default modifier onto a variable... default is not an actual modifier that should be specified?
Thanks

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

Re: Question about access modifiers

Post by admin »

Right, default is not an actual modifier. The absence of any modifier provides default access.
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 136 guests