Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


How does access modifiers work?



How does access modifiers work?..

Answer / javamasque

Public: It is the highest visibility access modifier. It makes visible the class members (variables/methods) to any classes (child/non-child) present within same or any package.
Protected: It has lesser visibility than public access modifier. It makes visible the class members (variables/methods) to sub-classes within same or different package and it also make visible in any class of same package.
Default: It has lesser visibility than protected access modifier. It makes visible the class members (variables/methods) to any classes within same package only.
Private: It has least visibility than all access modifiers. It makes visible the class members (variables/methods) within same class only.

Is This Answer Correct ?    4 Yes 0 No

Post New Answer

More Core Java Interview Questions

What is blank final variable?

0 Answers  


When can an object reference be cast to an interface reference in java programming?

0 Answers  


How do you define a singleton class?

0 Answers  


What is the statements?

0 Answers  


Explain creating threads by extending thread class ?

0 Answers  


What is quick sort in java?

0 Answers  


What are java methods?

0 Answers  


What are the 2 types of java programs?

0 Answers  


How a class can implement an interface?

5 Answers   SysArc,


Are global variables initialized to zero?

0 Answers  


What are the differences between graph and tree?

0 Answers   Amazon,


Which is fastest collection in java?

0 Answers  


Categories