Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can someone answer this

Status
Not open for further replies.

juanferman

Programmer
Nov 14, 2001
40
0
0
US
Guys,

I like to get the answer for the following question:

What access control keywords should you use to allow other classes to access a method freely within its package, but to restrict classes outside of the package from accessing that method ? Select all valid answers

1. public
2. protected
3. private
4. Do not supply an access control keyword

Thanks a lot for your help


===================
::) Juan F. Sarria
 
No access modifiers - allow access by classes or interfaces of the same package

protected - same as about plus allowing its sub-class to access it as well.

Since a sub-class can be outside of the same package, so I think the answer is 4.
 
Thanks a lot guys,

Actually the answer that I gave to the above question was: 2 and 4.

Any other thoughts ?



===================
::) Juan F. Sarria
 
Thanks again sedj and byam, now I know the truth.

Have a good weekend guys.

===================
::) Juan F. Sarria
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top