• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem with Toplevel Nested class

 
bani kaali
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
I am having problem with the code below,I am able to complie the code,but I am unable to run this.


I am gettign the following error --
In class AccessInTopLevelClass:
void main(String argv[]) is not defined

can anyone tell me whats going on and help me with this?

thanks,
bani
[ May 09, 2002: Message edited by: Marilyn deQueiroz ]
 
Jim Yingst
Wanderer
Sheriff
Posts: 18671
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In class AccessInTopLevelClass:
void main(String argv[]) is not defined
This is a clever cipher which conceals the fact that the method void main(String argv[]) is not defined in class AccessInTopLevelClass. ! Looking at your code, you do have a main() method, but looking at the parentheses it's actually in AccessInTopLevelClass.NestedTopLevelClass.NestedTopLevelClass1 - a doubly-nested static member class. This is not the same as AccessInTopLevelClass. When you type "java AccessInTopLevelClass", you're telling the JVM to look in that class for a main method. If it can't be found, you can't run your program.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic