What is the difference between and interface and an
abstract class ?

Answer Posted / porchelvi

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 ?    11 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the problem with multiple inheritance?

578


What is encapsulation selenium?

550


Can we define a class within the interface?

549


What is polymorphism and example?

586


Can private class be inherited?

613






What is oops in programming?

559


How to use CMutex, CSemaphore in VC++ MFC

4323


Are polymorphisms mutations?

691


What are the three parts of a simple empty class?

1447


write a program using c++ to implement single contiguous memory mangement techniques.display the content of the main memory after yhe allocation of jobs and percentage of the wastage of the main memory

2750


Which is better struts or spring?

612


What is encapsulation in oops?

531


What is the real life example of polymorphism?

602


What is encapsulation c#?

597


What is new keyword in oops?

586