• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Nested Classes

 
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 5575
Eclipse IDE Windows XP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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].
 
Your mother was a hamster and your father was a tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic