java - Inner class with main method doesn't compile -


abstract class manager {      static void test() {         system.out.println(12);     }      class manager1 {         public static void main(string args[]) {             system.out.println(manager.test());         }      } } 

it's producing compile time error. can abstract class have static method void type?

non-static inner classes cannot have static methods - top-level , static classes can (as per jls §8.1.3).

furthermore:

system.out.println(manager.test()); 

manager.test() void: can't print that.


Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -