Win a copy of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications this week in the Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Marcus Green #2 Question 8  RSS feed

 
Leonardo Silva
Greenhorn
Posts: 13
  • 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 args []){
}
}
The compiler complains about the access modifier in the Base Class. They have no inheritance relation and they are in the same package (as if it compile the .class files would be created in the same directory).
thnks
 
Paul Stevens
Ranch Hand
Posts: 2823
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Top level class cannot be private.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!