+ 1

What is the use of abstract class in java?

20th Jul 2018, 11:56 AM
Maninder $ingh
Maninder $ingh - avatar
2 Respostas
+ 1
I don't know java, but an abstract class is a class that can't be instanced but can be inherited by another class. It is useful when you make a class like "Character" that is not a character itself but gives the basic Position, Walk and Eat. Any special character type inheriting Characyer is a real character type and can be instanced.
20th Jul 2018, 12:02 PM
Lil Taco
Lil Taco - avatar
0
Imagine that you have an hierachy of classes that share some code... Its probable that do you make a super class then subclass it... But what if do you want make instanciable only subclasses? In this case abstract class help you to define this behaviour
20th Jul 2018, 12:12 PM
KrOW
KrOW - avatar