What are access specifiers in java? Explain with examples?

Showing Answers 1 - 8 of 8 Answers

Manikandan

  • Jan 24th, 2006
 

Access Specifiers in java,

Public, Private, Producted

  Was this answer useful?  Yes

Ken

  • Mar 2nd, 2006
 

I believe there a FOUR access specifiers:

1> public

2> private

3> protected

4> default (not specified, in which case its "package private" in its scope) 

  Was this answer useful?  Yes

MM

  • Nov 7th, 2006
 

PLZ TELL ME HOW TO CONNECT JAVA WITH MS ACCESS WITH A COMPLETE EXAMPLE.

  Was this answer useful?  Yes

variable or methods scope or boundary will depend on access specifiers, In java we have mainly 4.
namely public, private , protected and default.

public : The Variables and methods can be access any where and any package.
protected : The Variables and methods can be access same Class, same Package & sub class.
private : The variable and methods can be access in same class only.
default : The variable and methods can be access in same package only.

  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