This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes doubt in access modifiers... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "doubt in access modifiers..." Watch "doubt in access modifiers..." New topic
Author

doubt in access modifiers...

Erum Momin
Ranch Hand

Joined: Jun 10, 2009
Posts: 32
Hi all,
can anyone tell me what will be the result of following case?

package foo;
public class Sup{
void doit();
}

what can access the doit();
A. Any class
B. only the Sup class
C.any class in package foo
D. any class that extends Sup.
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10170
    
    8

http://java.sun.com/docs/books/tutorial/java/javaOO/accesscontrol.html


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: doubt in access modifiers...
 
Similar Threads
Assertions
finalize() method
static inner class question.
IllegalAccessError and Classloaders.
Question about the Thread / Synchronization --- SCJP mock Exam