Public : Any other class from any package can instantiate and execute the classes and methods.:the three acess specifiers public, private, protected. public means can run outside the class, private means can run within the class.protected means it takes the similarities of both the public and private and it runs according to those specifiers:public:the class members of any package can access the base class.:there are 4 access specifier in java public,private,protected,friendly.:Dear Friend,:private modifiers can be accessed from only withing the same class.:There are 3 main access specifiers.. 1.Public() :-anything declared as public can access from anywhere.:Protected Member - A protected member is the same as a private member except that a protected member of a base class is inherited by a derived class, whereas a private member is not.
Category:Java Interview Questions
No comments:
Post a Comment