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
what is the number of water, sand and cement required for moulding brick?
postfix expression for x^y^z-m+n+p/q ?
2. A product selected for testing is equally likely to have been produced by one the 6 machines/processes. (i) Determine sample space āSā (ii) What is the probability that the product is from machine 1? (iii) What is the probability that the product is from machine 2 or machine 4? (iv) What is the probability that the product is from both machine 5 and machine 3? (v) What is the probability that the product is not from machine 6? (vi) What is the probability that the product is not from either machine 6 or machine 1?
what is the use of fact tables in your banking project doveleped with teradata?
tell the function of Source record of DNS server. why we create Stub zone? Tell Round Robing also?
Can u send me a sample Final year CSE student 'RESUME' for campus placement to following mail id: aspnetworks@gmail.com
what is technical voice process and define it
Guys! I coplted 10th with 80% and +2 with 64% now am dng c.s.e b.tech...i want to go abroad for higher studies i want to write tofel...plZ GIVE UR SUGGESTIONS!
Why did they used to make the mill chimneys so tall?
Is there aptitute question will be asked in NIC exam ??? If yes how many questions will be asked??
while installing jad file to mobile its giving processing attribute MDlet-jar-URL error...how to fix it
Suppose that, even unrealistically, we are to search a list of 700 million items using Binary Search, Recursion (the algorithm given in class). What is the maximum number of comparisons that this algorithm must perform before finding a given item or concluding that it is not in the list?
i have an interview in Qatar Petroleum. So please provide the all details abt safety management
what is advantages and disadvantages of CAT5,CAT5e,CAT6,CAT7,COAXIAL CABLE,FIBER-OPTIC
what is different between static block and public static void main??