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

Popular posts from this blog

django - (fields.E300) Field defines a relation with model 'AbstractEmailUser' which is either not installed, or is abstract -

matlab - error with cyclic autocorrelation function -

php - Using grpc in Laravel, "Class 'Grpc\ChannelCredentials' not found." -