class Demo { void show() { System.out.println(\"i am in show method of super class\"); } } class Flavor1Demo { // An anonymous class with Demo as base c
Thats because you try to use d that belongs to object in static method.
d
You would then have to create that object in main method.
static belongs to class, not object itself.
I want to know the difference between static method and non-static method