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 the use of join method?
Why vector is used in java?
Why do we need data structure in java?
What is valid keyword in java?
Explain the scope of a variable.
Differentiate between class and structure.
Write an algorithm for quick sort?
What is difference between variable declaration and definition?
What class allows you to read objects directly from a stream?
can java object be locked down for exclusive use by a given thread? Or what happens when a thread cannot acquire a lock on an object? : Java thread
What is the size of string?
how to create daemon thread in java?
What is :: operator in java?
What is a blocking method in Java?
What is the intersection and union methods?