aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes scjp 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 » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "scjp" Watch "scjp" New topic
Author

scjp

nagaraj reddy
Ranch Hand

Joined: Feb 21, 2005
Posts: 43
private class Base{}

public class Vis{
transient int iVal;
public static void main(String elephant[]){
}
}

when we compile it what would be the output

From one mock exam i found that it is error and indicating that Base should not be Private

Is it Correct...........

u can find this question on the link (question NO:7)
http://www.jchq.net/mockexams/exam2.htm
Paulo Aquino
Ranch Hand

Joined: Apr 29, 2002
Posts: 200
Top level classes can't be private. This is what ive got when i run your code:



modifier private not allowed here
private class Base{}


Be Afraid...Be very Afraid...
v nithya
Greenhorn

Joined: Mar 30, 2005
Posts: 3
hi,
In general a top level class cannot be marked with private nor protected access.these top level classes can be marked only as public or can have default access.
(however you can have all these access modifiers for inner classes)
so,ur code gives error.
regards,
-nithya
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: scjp