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");
	}

}

❤Cash Back At Stores you Love !!!❤

Earn your $10 reward when you make your first purchase through Ebates by signing up with clicking below button.

Ebates Coupons and Cash Back

More Related questions...

Show more question and Answers...

Enum

Comments & Discussions