Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

if u r using bugzilla then it generates automatic bugids,while testing uhave got a bug then bug is represented through a bug id say bug1, then bug is assigned to developer he fixes a bug ,say the bug is fixed no error is got later after few regression cycles u have got the same bug but the bug is represented by diff id say bug2,tell me how do i come to know that it is the same bug that had occured previously but now it is represented by diff id

1990


WAP in Java to print the format: ABC BCD CDE EFG

2566


Index of an Array containing 'n' aliment varies from________to_______

2045


#include int fn(int v); main() { printf("%d\n",fn(7)); } int fn(int v) { if(v==1 || v==0) return 1; if(v%2==0) return fn(v/2)+2; else return fn(v-1)+3; }

2009


c# code, vb.net code language parity refers to what?

3515


when there is a parametrized constructor, and an object is created with no arguments. will the default constructor be called?

2430


Tell me all about production of drought and its losses In the boiler?

1715


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....

1872


plz send me interview questions & answers of Data Structure

2056


what are the no. of leaf nodes in a fibonacci tree ?

2482


please explane me clusterd and non clusterd

2008


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?

1988


how to convert postfix notation into prefix in data structures. please send me algo of taha

3079


why you are suitable to work here???? plzz give me the ans f this Q. i was told to write 200 words on the spot....

2180


what is difference between class and object in c++

2258