Which class is super class of every class

What do you understand by private protected and public modifiers

Answer : It use to hide data with the code where it manipulates. Though encapsulation also provide very important attribute called access control. Through encapsulation you can control which part will have access to the member of a class. In java access specifiers are private, protected and public and it also defines default access level. Below table shows how these variable control access when define i the class:

Access Levels

ModifierClassPackageSubclassWorld
publicYYYY
protectedYYYN
no modifierYYNN
privateYNNN

Leave a Reply

Your email address will not be published. Required fields are marked *