Click here to Skip to main content
15,905,679 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Why the code from the picture does not output

https://ibb.co/878fshp

What I have tried:

I think that it is not brought out with anything
Posted
Updated 22-Dec-21 2:54am

You have created object for an abstract class which is not possible in java. If you want you can create a reference variable for an abstract class.
 
Share this answer
 
The whole idea of an abstract class is that you cannot create an instance of it: you always create instances of classes which derive from it.

Think of an abstract class as a Car: You can drive a car, you can own a car, you can crash a car. But you don't build a car - you build a Ford Focus, or a Mercedes A250e - you build an instance of a derived class: a Car -> Ford -> Focus
Car is abstract, Ford is abstract derived from Car, Focus is concrete, derived from Ford.

You can build that because it supplies information that allows an actual instance of a car to be defined.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900