I do not clearly undurstand abstract classes in Java programming Language. I just want to see one concrete example to understant | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
+ 2

I do not clearly undurstand abstract classes in Java programming Language. I just want to see one concrete example to understant

Why Java Abstract classes

10th Jul 2017, 11:20 PM
Stephcyrille
Stephcyrille - avatar
7 Antworten
+ 1
Hmmm... Yes, but it is a parent or super class that inherits it's functions (commonly for overriding) but it doesn't do anything by itself !---It's not a professional explanation---!
10th Jul 2017, 11:36 PM
Andr├ęs04_ve
Andr├ęs04_ve - avatar
+ 2
it can ne considerated at a parent class??
10th Jul 2017, 11:32 PM
Stephcyrille
Stephcyrille - avatar
+ 2
yeah! thanks! I just have some more ideas
10th Jul 2017, 11:40 PM
Stephcyrille
Stephcyrille - avatar
+ 2
public abstract class Boy{ abstract void eat(); }
11th Jul 2017, 12:00 AM
Stephcyrille
Stephcyrille - avatar
0
Are classes with only virtual functions. Abstract classes are used only for inherit it's contents
10th Jul 2017, 11:24 PM
Andr├ęs04_ve
Andr├ęs04_ve - avatar
0
Try making a simple code and let me see if you got the point
10th Jul 2017, 11:42 PM
Andr├ęs04_ve
Andr├ęs04_ve - avatar
0
hmmm, not exactly. The class could be an animal class that inherits to dog, cat and other animals class. Then every sub-class defines the abstract method with different behaviors (in this case, everyone eats different things)
11th Jul 2017, 12:05 AM
Andr├ęs04_ve
Andr├ęs04_ve - avatar