I am trying to execute this code in eclipse.
class Outer {
class Inner {
int i = 10;
}
}
class OInnerDemo {
public static void main(String[] args) {
Outer o = new Outer();
Outer.Inner i = o.new Inner();
System.out.println(i.i);
}
}
But I am getting an error message :
Error: Main method not found in class OInnerDemo, please define the main method as: public static void main(String[] args) or a JavaFX application class must extend JavaFX.application.Application
But I have executed the same code in cmd and I got the output as 10. Why is this code not executed in Eclipse?