• Post Reply Bookmark Topic Watch Topic
  • New Topic

Nested Classes  RSS feed

 
Aruna Balasuriya
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Following cord

class OuterOne{

static class NestOne{

static void methodOne(){ System.out.println("One");}
}
}
public class OuterTwo {
static class NestTwo{

static void methodTwo(){System.out.println("Two");}

public static void main(String[] args) {

OuterOne.NestOne.methodOne();
OuterTwo.NestTwo.methodTwo();
}

}

}


Results

java.lang.NoClassDefFoundError: OuterTwo/NestTwo
Exception in thread "main"
Java Result: 1

Please expain why RunTimeException
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please use code button to post your code. and java.lang.NoClassDefFoundError --> it shows that your class file is not in the class path[i.e, javac.exe can point your .java file.but java.exe cant point your .class file].
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!