What is the benefit of abstract class? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

What is the benefit of abstract class?

14th Nov 2018, 2:55 PM
Nazmul Islam Naim
Nazmul Islam Naim - avatar
2 Answers
+ 3
For understanding the concept of abstract method Lets take an example of Birds . Now all type of Birds share some common properties(sleeping,eating,walking) but they use these properties in different -different manner.Now the next question arises how? How they use these common properties in different manners ? Lets take our first property i.e sleeping, now some of the bird sleeps at day time like an owl but many of them sleeps at night so this how they are using this behavior in different -2 manner. When the same functionality is find in many objects we declare that behavior as abstract method i.e with no implementation so that a class extending an abstract class can provide its own implementation for those functionalities.
14th Nov 2018, 3:13 PM
Maninder $ingh
Maninder $ingh - avatar
0
Guys i have this kind of confusion in java programming. so guys can anyone else briefly explain indexOf() methond in java.
14th Nov 2018, 3:17 PM
Uhsie
Uhsie - avatar