Page 1 of 1

Question about access modifiers

Posted: Mon Jan 08, 2024 1:27 pm
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

Re: Question about access modifiers

Posted: Mon Jan 08, 2024 7:28 pm
by admin
Right, default is not an actual modifier. The absence of any modifier provides default access.