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

What's the range of C/A?

2 Answers   Ericsson,


How do I unlock my laptop if I forgot my administrator password, a Toshiba running Windows 7?

2 Answers  


explain in detail about life cycle of thread

0 Answers  


what is LINUX?

5 Answers  


Q1. A. Discuss the various types of variables. B. How to control the file? Q2. A. How the image application? B. Write short notes on trees structures work. Q3. A. How to load and unload child forms. B. When should we use recursive programming Q4. A. Write short notes on “The ole control’s shortcut menu” B. How to test the AX stat class Q5. A. How to use advanced data-bound controls. B. Write notes on manipulating the recordset object Q6. A. What is script control? B. How to down load image properties. C. What is meant by building a recordset.

0 Answers   IBM,






An inversion is an array of numbers is any pair (i,j) such that i<j and A[i]>A[j]. What is the average number of inversions in an array of n distinct numbers? plz GIVE ME SOLUTION

0 Answers   TCS,


what is the different between view and materialized view in oracle DBA?

0 Answers   Wipro,


out of fgets() and gets()which function is safe to use and why in c language?

1 Answers  


. There are two water tanks A and B, A is much smaller than B. While water fills at the rate of 1 liter every hour in A, it gets filled up like, 10, 20, 40,80, 160…..in tank B. (At the end of first hour, B has 10 liters, second hour it has 20 liters and so on). If tank B is 1/32 filled of the 21 hours, what is total duration of hours required to fill it completely?

3 Answers   TCS,


true and false 1. The jawa source code can be created in a notepad editor. 2. The value of 111% 13 is 3.

2 Answers  


Write a program to print Pattern 1) If user enters 3 1 2*3 4*5*6 4*5*6 2*3 1 2) If user enters 4 1 2*3 4*5*6 7*8*9*10 7*8*9*10 4*5*6 2*3 1

0 Answers   Amdocs,


how am i supposed to convert a class program in C++ to Matlab? Do i also need to make classes in matlab too or I can do it without making classes???Can somebody help....

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)