Consider the following program and predict the behavior of this program:.
class Base {/*from ww w . j a v a 2s .c o m*/ public void print() { System.out.println("Base:print"); } } abstract class Main extends Base { //#1 public static void main(String[] args) { Base obj = new Base(); obj.print(); //#2 } }
AbstractClassInstantiationException
C.
An abstract class can extend a concrete class.
An abstract class can have static methods.
You don't need to create an object of a class to invoke a static method in that class.
You can invoke the main()
method defined in an abstract class.