Please can someone tell me why this code gives the foll error?it seems we cant create an instnace of static nested class with new()
import java.io.*;
class Sample {
public static void main( String arg[] ) {
System.out.println("I'm a little sample, short and ... ");
Sample.LittleSample b = new Sample().new LittleSample();
}
static class LittleSample {
static String str = "stout";
LittleSample() {
System.out.println(str);
}
}
}
A.java:5: qualified new of static class
Sample.LittleSample b = new Sample().new LittleSample();