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
What is string buffer?
Can a constructor have different name than a class name in java?
What is a vector in java?
What are the loops in java?
What is the java virtual machine?
Can we clone singleton object?
How do you declare a destructor in java?
How to sort elements in a parallel array in java?
Assume a thread has lock on it, calling sleep() method on that thread will release the lock?
What is wrapper class example?
What are thread groups?
Explain the importance of throws keyword in java?
What state does a thread enter when it terminates its processing in java programming?
How dead lock situation occurs in java and how you can identify it?
How to make a read-only class in java?