what is abstract method with example?
Answer Posted / vikram
Hi Gopal, well I will explain u abstract methods in
layman's language. Sometimes, we want a method to perform
different functionalities. for eg. if suppose we have a
method dat finds d the area of geometric figures. Now every
geometric figure has different formula for calculating the
area. In dat case we go for abstract methods. where we just
declare a method by any name, in our case let it be "area
()". Now we can construct the body of this method depending
upon the type of geometric figure and the formula required
to find its area, seperately for all geopmetric figures.
But we will use the same name "area()" for all the methods
dat we define below to find the areas. I hope u got a vague
picture of abstract methods.
| Is This Answer Correct ? | 26 Yes | 7 No |
Post New Answer View All Answers
When parseint method can be used?
Which collection is ordered in java?
What do you mean by exception handling in Java?
Howto get an object that will perform date & time calculations then format it for output in some different locales with different date style.can ne1 tel me the answer of this question.pls
Can final class have constructor?
Explain the private protected method modifier?
Can I declare a class as private?
How to create an immutable class?
What is difference between core java and java ee?
What is the default size of arraylist in java?
Is 0 an even number?
Do I need to import java.lang package any time? Why?
What is arraylist e in java?
What is the statements?
What is the difference between comparison done by equals method and == operator?