java - Can a child class creates object of type super class that is abstract? -
i'm not sure if asked correctly i'm given in assignment
classa abstract
classb extends class a
then in main method of classb have:
classa obj = new classb();
what's happening here , what's purpose of doing so?
you can never create object abstract class. ever. period.
here variable gets assigned object of abstract type, object variable refers not , never can be. distinction between reference , reference variable key concept must understood advance, once it, you'll go "a-ha!".
Comments
Post a Comment