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


Please Help Members By Posting Answers For Below Questions

How many types of keywords are there?

564


What is the difference between array list and vector in java?

509


Can a constructor have different name than a class name in java?

592


Why are functions called methods in java?

528


What are actual parameters?

522






What is lastindexof in java?

548


Give me example of derived data types.

594


Why is it important to initialize a variable?

491


What is the difference between array and array list in java?

607


What is the difference between scrollbar and scrollpane?

607


What is the purpose of javac exe?

560


Explain about fail fast iterators in java?

562


What is the maximum length of a url?

511


extending thread class or implementing runnable interface. Which is better? : Java thread

563


What are the steps involved to create a bean?

683