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


In which Scenario you will go for Interface or Abstract Class?



In which Scenario you will go for Interface or Abstract Class?..

Answer / swetcha

Interfaces, like classes, define a set of properties,
methods, and events. But unlike classes, interfaces do not
provide implementation. They are implemented by classes,
and defined as separate entities from classes. Even though
class inheritance allows your classes to inherit
implementation from a base class, it also forces you to
make most of your design decisions when the class is first
published.
Abstract classes are useful when creating components
because they allow you specify an invariant level of
functionality in some methods, but leave the implementation
of other methods until a specific implementation of that
class is needed. They also version well, because if
additional functionality is needed in derived classes, it
can be added to the base class without breaking code.

Is This Answer Correct ?    12 Yes 2 No

Post New Answer

More OOPS Interview Questions

What is encapsulation?

17 Answers   TCS,


What is a unary operator?

5 Answers  


Why do we use class in oops?

0 Answers  


Write a program to demonstrate the use of 'Composition' in C++

2 Answers  


What is public, protected, private?

6 Answers   IBS, Satyam,


What exactly is polymorphism?

0 Answers  


whats the difference between c and c++

7 Answers   Syntel,


What is a linked list?

10 Answers   IBM, Neural Info,


Base class has two public data members. How can i derive a new class with one datamember as public and another data member as private?.

2 Answers  


What is late bound function call and early bound function call? Differentiate.

2 Answers   Ness Technologies,


define a string class. overload the operator == to compare two strings

2 Answers   Birla, Ericsson, HCL, Infosys, Infotech, MCAS, Satyam,


Where You Can Use Interface in your Project

0 Answers   KPIT,


Categories