What is the differances between a abstract calss and
interface

Answers were Sorted based on User's Feedback



What is the differances between a abstract calss and interface..

Answer / maria alex

An abstract class holds both method prototpypes and method
definitions also...But it is not in the case of
interface..It can contain only protypes.. It should be
defined only where it is implemented...

Is This Answer Correct ?    20 Yes 3 No

What is the differances between a abstract calss and interface..

Answer / abhijit

Abstract base classes can have data members but not interfaces.

Abstract base classes have private access specifier by
default while that of interfaces is public

Is This Answer Correct ?    8 Yes 0 No

What is the differances between a abstract calss and interface..

Answer / porchelvi .a

ABTRACT CLASS:
-------------
• It can not be instantiated

• It allow us to specify all access modifier except
Private

• A class inheriting this must implement all of its
abstract method


• A class can inherit only one abstract class at a
time.

• Abstract class can add more functionality with out
destroying child classes that were using old version.


• We can declare the following
1. Fields
2. Constructors
3. Static Constructors
4. Static Functions
5. Concrete Functions

INTERFACE :
---------

• It can not be instantiated

• It allows only public Access modifier

• A class implementing interface must provide body
for its entire member.



• A class can implement more than one interface at a
time.

• Adding of additional functionality will have an
effect on its child class due to the necessary
implementation of interface methods.

• We can not declare the following
1. Fields
2. Constructors
3. Static Constructors
4. Static Functions
5. Concrete Functions

Is This Answer Correct ?    4 Yes 0 No

What is the differances between a abstract calss and interface..

Answer / rck

Abstract class is the class which may contain pure virtual
functions as well as normal functions where as interface
may only contain pure virtual functions.

Is This Answer Correct ?    3 Yes 0 No

What is the differances between a abstract calss and interface..

Answer / kanan

Abstract class: You can inherit only one class.
Interface: You can inherit more than one interface.

Abstract class: It contains both completed and uncompleted
(abstract) methods.
Interface: It only contains uncompleted methods (methods
without body).

Abstract class: Access modifiers are there for methods and
properties.
Interface: It does not have access modifier for methods or
properties. By default they are public.

Abstract class: Fast
Interface: Require more time to find actual method in classes.

Abstract class: It can contain fields and constants.
Interface: no fields can be defining in interface.

Is This Answer Correct ?    3 Yes 0 No

Post New Answer

More OOPS Interview Questions

Why is polymorphism important in oop?

0 Answers  


Where is pseudocode used?

0 Answers  


WHAT IS THE DIFFERENCE BETWEEN OBJECT BASED & OBJECT ORIENTD PROGRAMMING LANGUAGE.(GIVE AT LIST 4 PIONT)

1 Answers   TCS,


why oops need in programming

7 Answers   TCS,


Why static Function is used in C++?

4 Answers   TCS,






1. Strong name 2. how to prevent a class from being inherited 3. delegates 4. default modifier for interface 5. default modifier for class 6. base class for exception 7. diff bet trigger and view in sql 8. how to exchange values from one page to another page 9. can multiple catch block ll be executed at same time 10. can u store different data types in an array & array list 11. when we ll use trigger 12. try,catch,finally usage

2 Answers  


What are the OOPS concepts?

106 Answers   A1 Technology, Bajaj, CTS, EDS, HP, Infosys, Intel, Microsoft, MNC, Persistent, PlanetSoft, ProConstructor, TCS, Virtusa, Wipro, YSoft Solutions,


Why a "operator=(...)" when there is a copy ctor?

2 Answers  


what is new modifier in C#

8 Answers   HCL,


WRITE A SIMPLE C++ PROGRAM TO SWAP TWO NOS WITHOUT USING TEMP

2 Answers  


just right the logic of it 1--> If few people are electing then every time ur candidate should win 2--> arrange books in box, if box carry weight == books weight then take another box..... find the no of box required.

0 Answers  


what is function overloading..?

4 Answers  


Categories