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
How many types of keywords are there?
What is the difference between array list and vector in java?
Can a constructor have different name than a class name in java?
Why are functions called methods in java?
What are actual parameters?
What is lastindexof in java?
Give me example of derived data types.
Why is it important to initialize a variable?
What is the difference between array and array list in java?
What is the difference between scrollbar and scrollpane?
What is the purpose of javac exe?
Explain about fail fast iterators in java?
What is the maximum length of a url?
extending thread class or implementing runnable interface. Which is better? : Java thread
What are the steps involved to create a bean?