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
In order to access methods or variables in main class without creating object in it,here we are defining anonymous inner class where we create object of static type so that its directly accessed from main class without creating the object.