what is the use of declaring abstarct method without using it in parent class ??? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

what is the use of declaring abstarct method without using it in parent class ???

13th Oct 2016, 7:42 AM
Sandeep reddy
Sandeep reddy - avatar
2 Answers
+ 1
can you explain a little bit more
13th Oct 2016, 10:56 AM
damilare lamidi
damilare lamidi - avatar
+ 1
You mean declaring a fully abstract method? So that the parent class knows that the method exists. Suppose you have a parent class ArrayList that you fill with objects of derived classes. You can then call the method that was fully abstract when defining the parent class but that had been defined in the derived classes on each object of the ArrayList, taking advantage of the polymorphism.
13th Oct 2016, 1:06 PM
Zen
Zen - avatar