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 are checked exceptions?

0 Answers  


Does constructor return any value?

0 Answers  


Which is the best way of exception handling?

2 Answers   Oracle,


What is the difference between an inner class and a sub-class?

0 Answers  


How can we make sure main() is the last thread to finish in java program?

0 Answers  


what is thread in Java ?

0 Answers  


What are pass by reference and pass by value?

0 Answers  


What are the uses of final, finally and finalize in java?

2 Answers   Agiline, FINO PayTech, HCL,


What is difference between == equals () and compareto () method?

0 Answers  


What is wrapper class html?

0 Answers  


Is empty string in java?

0 Answers  


How does serialization work

3 Answers   Ordain Solutions,


Categories