GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  J2EE
Go To First  |  Previous Question  |  Next Question 
 J2EE  |  Question 16 of 104    Print  
What are the different acess specifiers?

  
Total Answers and Comments: 9 Last Update: September 15, 2007     Asked by: suresh 
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
February 25, 2006 20:36:37   #1  
radhika        

RE: What are the different acess specifiers?

the different access specifiers are

public:

private:

protected:

friendly :


 
Is this answer useful? Yes | No
March 03, 2006 03:48:07   #2  
PavanKumar B        

RE: What are the different acess specifiers?

Java has four different access specifiers: public private package and protected.

private : The most restrictive of the access specifiers is private. If a variable [or a method] is declared private then it can only be accessed by methods in that class.

public : The least restrictive of the access specifiers is public. If a method has public in front of it then any object of that class can be told to perform that action.

package : Every class that is in the same package has access to the fields and methods in your class.

protected : If you have a variable or method in your class that you don't want clients of your class directly accessing declare it protected.

I Think Classes in the same package are said to be friendly..It is not Acess Specifier


 
Is this answer useful? Yes | No
March 07, 2006 22:41:17   #3  
dev        

RE: What are the different acess specifiers?

Hi Radika

Frindly is not there in java

Access Specifiers are public private protected and default


 
Is this answer useful? Yes | No
March 09, 2006 06:57:55   #4  
Ranjith Kumar Member Since: March 2006   Contribution: 2    

RE: What are the different acess specifiers?

Hi All

Access specifiers include:

public private protected (explicit specification).

If there is a class with no explicit specification with above modifiers the class is said to be having a default access.

Hence no friendly or default keywords are used for access modifier. However default keyword is used in switch.. case construct.


 
Is this answer useful? Yes | No
March 09, 2006 06:59:11   #5  
       

RE: What are the different acess specifiers?

Hi All

Access specifiers include:

public private protected (explicit specification).

If there is a class with no explicit specification with above modifiers the class is said to be having a default access.

Hence no friendly or default keywords are used for access modifier. However default keyword is used in switch.. case construct.


 
Is this answer useful? Yes | No
March 21, 2006 05:40:12   #6  
srinivas.bora        

RE: What are the different acess specifiers?

hi friends

public: Any thing declared as public can be accessed from anywhere. private: Any thing declared as private can t be seen outside of its class. protected: Any thing declared as protected can be accessed by classes in the same package and subclasses in the other packages. default modifier : Can be accessed only to classes in the same package.okey baye.......

if there is any Questionon j2se and j2ee plz send to my mail id

bora_srinivasarao@yahoo.co.in

keeps smiling and mailing

bora_srinivasarao@yahoo.co.in


 
Is this answer useful? Yes | No
April 06, 2006 01:13:08   #7  
chandra        

RE: What are the different acess specifiers?

hello all i am chandra

friendly is not access specifiers in java above all are access specifiers but default is also accessfiers .

bye chandra


 
Is this answer useful? Yes | No
October 17, 2006 01:12:20   #8  
sudha        

what is the technical architecture?

what is the technical architecture?

what is the project architecture?


 
Is this answer useful? Yes | No
September 15, 2007 03:43:33   #9  
snehlata        

RE: What are the different acess specifiers?

there are 4 access specifiers defined in java.
private: who can be accessed within class only.
default:who can be accessed within the same package.
protected: who can be accessed within the same package and by subclass of other package.
public: who can be accessed everywhere i.e. within the same package and any other package.


 
Is this answer useful? Yes | No


 
Go To Top


 Sponsored Links

 
About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape