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

Is a class subclass of itself?

715


What is ++ a in java?

653


Are constructors methods?

666


What is ide with example?

635


What is the difference between length and size in java?

594






What is sortedset in java?

662


What is the difference between variable declaration and variable initialization?

601


What is time complexity algorithm?

646


what is singleton class in java?

694


Why main method is static in java?

702


Give a brief description of java socket programming?

637


Where is the find and replace?

626


What are the java ide’s?

678


how we can create packages in java?

605


What is stringreader?

613