What are the types of access modifiers

Showing Answers 1 - 14 of 14 Answers

M.Manikumar

  • Aug 13th, 2005
 

1)final 
2)static 
3)transient 
4)synchronized 
5)abstract 
6)const 

  Was this answer useful?  Yes

There are two types of access modifiers

1. Class access modifiers
    There are three class modifiers : public, private and protected
    There are four level access level : public, private, default and protected
    Class can have only one public or default class.
   
2. Member level access modifiers
    Methods and instances variable ( nolocal )  are known as member
    There are four method access level modifier : private, public, protected and default


Visablity                          Public    Default     Protected  Private
    From the same class       Yes       Yes          Yes            Yes
   
    From any class in
    the same package           Yes       Yes          Yes             No
   
    From a subclass in
    the same package           Yes       Yes          Yes            No
   
    From a subclass in           Yes        No           Yes           No         
    the different package
   
    from any non  subclass
    in the outside package    Yes       No             No           No

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions