Could anyone please tell me why the code below doesn't work ?
public class NestedClassPrac {
public static class Nested {
public void sayHello() { System.out.println("First nested class~");}
public static class LittleNested {
public void sayHello() { System.out.println("this is why we are nested class");}
}
}
public static void main(String[] args) {
Nested a = new Nested();
a.sayHello();
LittleNested b = new LittleNested();
b.sayHello();
}
}
error msg:
NestedClassPrac.java:13: cannot find symbol
symbol : class LittleNested
location: class NestedClassPrac
LittleNested b = new LittleNested();
^
NestedClassPrac.java:13: cannot find symbol
symbol : class LittleNested
location: class NestedClassPrac
LittleNested b = new LittleNested();
^
2 errors