aspose file tools*
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 Spring in Action this week in the Spring 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: 10451
    
    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!]
 
wood burning stoves
 
subject: doubt in access modifiers...