This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

scjp

 
nagaraj reddy
Ranch Hand
Posts: 43
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 202
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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{}
 
v nithya
Greenhorn
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic