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

What is array length?

514


what is thread? What are the high-level thread states? : Java thread

799


What is array size in java?

508


What is the output of the below java program?

605


Enlist few advantages of inheritance?

596






What is off heap memory?

560


What are the four pillars of java?

620


What is a java list?

592


Does substring create a new object?

537


What is the buffer limit?

575


Can we overload run() method in java?

605


Can a class be protected in java?

518


Is oracle charging for java?

553


What are the different types of methodologies?

535


A person says that he compiled a java class successfully without even having a main method in it? Is it possible?

597