| 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
|
 |
 |
|
|
subject: scjp
|
|
|