why we need abstract class in java, what is the diff b/w
abstract claas in c++ and abstract class in java



why we need abstract class in java, what is the diff b/w abstract claas in c++ and abstract class ..

Answer / 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

More Engineering AllOther Interview Questions

is the meter head is same as back pressure?

0 Answers   GDex,


am a textile eng. frombut with major of my course including chemical eng, subjects, can i too apply to the co.?

0 Answers  


If any kind of accident happen without any information to any one .what kind of action we have to take

0 Answers  


reverse a number ( like 1234 into 4321) using malloc in C programming

0 Answers   TCY Online,


hello sir,pls fdorward previous group-I exam papers .....

0 Answers   APPSC,






is java supprot the complier time pollymorphism or run time pollymorphism ... why

0 Answers   HCL,


What do u mean constructor in java ?

1 Answers  


give me some knowledge about automation on which asked on interview

0 Answers  


Please mail me the sample papers of PNB for the post Dy. Manager.

0 Answers  


Explain how a TP Monitor manages memory and processor resources more effectively than a typical operating system.

1 Answers   Infosys,


why unix commands simpler rather than complex task

0 Answers  


How many VLANs are supported on a single switch

0 Answers  


Categories
  • Civil Engineering Interview Questions Civil Engineering (5085)
  • Mechanical Engineering Interview Questions Mechanical Engineering (4451)
  • Electrical Engineering Interview Questions Electrical Engineering (16632)
  • Electronics Communications Interview Questions Electronics Communications (3918)
  • Chemical Engineering Interview Questions Chemical Engineering (1095)
  • Aeronautical Engineering Interview Questions Aeronautical Engineering (239)
  • Bio Engineering Interview Questions Bio Engineering (96)
  • Metallurgy Interview Questions Metallurgy (361)
  • Industrial Engineering Interview Questions Industrial Engineering (259)
  • Instrumentation Interview Questions Instrumentation (3014)
  • Automobile Engineering Interview Questions Automobile Engineering (332)
  • Mechatronics Engineering Interview Questions Mechatronics Engineering (97)
  • Marine Engineering Interview Questions Marine Engineering (124)
  • Power Plant Engineering Interview Questions Power Plant Engineering (172)
  • Textile Engineering Interview Questions Textile Engineering (575)
  • Production Engineering Interview Questions Production Engineering (25)
  • Satellite Systems Engineering Interview Questions Satellite Systems Engineering (106)
  • Engineering AllOther Interview Questions Engineering AllOther (1379)