why we need abstract class in java, what is the diff b/w
abstract claas in c++ and abstract class in java
Answer Posted / nikhil naoghare
Abstact classses are those classes which can have abstact as well as Common methods. we use Abstract classes because we want to implement Polymorphism.
Its always good to prefer the abstract class because it will give us the addtional method declaration in the class.
We use Abstract class to enforce some rules to the classes which extends it. For example we can define a class say Car and we can declare methods say Color() Mileage(). This means whatever the class that is derived from Car has to override or give definition for Color() and Mileage() and therefore we are making sure that all the derived classes follows or has the common functionalities. In other way the classes derived from superclass should have common properties. In addition to this the derive class can have its own methods like Type().
In case of Abstract class we can define COMMON functionalities in super class and those can be used in the derived class where as in Interface we cant do that.
Is This Answer Correct ? | 11 Yes | 3 No |
Post New Answer View All Answers
Suppose you want to form a conceptual model of UML.What elements would you require for this purpose?
What is the instruction to load the register B?
What is Landscape in Sap BW?
what is rapid application development
What is Mointer in Operating System?
How can we share data between actions in qtp..pls tell me
please tell me difference between router and cisco router
find the net id and host id of the following IPV4 117.34.3.8 and 132.57.8.6
if a customer's blackberry stopped syncing their calendar wirelessly what would you do?if a customber deleted mail from his blackberry but it did delete from his mailbox how would ypu resolve this
hi i have selected for nda and could please send me the courses offered in nda regarding engineering and all other courses????
What is the pattern for HAL Online-exam?
question no. 4======Give a brief description of the following terms: a) Play head b) Symbol c) Tweening d) ActionScript e) Frame rate f) Library panel g) Masking h) Context – sensitive Property Inspector i) Bandwidth Profiler j) Frame Label
i want to know ,If a five-digit number is input through the keyboard, write a program to calculate the sum of its digits.
How to select the total numbers of fire extinguisher installed in a room ?
WHAT IS DIFFERENT BETWEEN YOU AND OTHER APPLICANT TO GIVE YOU THE JOB