Prev Next

Java / Abstract Class

Can an abstract class have the main method?

Yes, it is also a static method and it can execute the abstract class.

public abstract class AbstractClassMain {
	
	public static void main(String[] args) {
		System.out.println("Hello from abstract class");
	}

}

More Related questions...

Show more question and Answers...


Comments & Discussions