Interface Vs Abstract
Implementation :
1.Interface is a collection of DataMembers and Member Functions .But We cannot implement that DataMember and Member Functions .
1.Abstract class we can implement it .
Modifiers :
2. In Default interface contains public modifiers
2.But in abstract we can use private ,public modifiers
Inherit :
3.In interface we can inherit more than one interface in a class .
3. In abstract class we can inherit only one abstract class .
Methods;
4. All methods must be implemented ,otherwise we got an error message.
4. Need not be implement all decalre methods .
Implementation :
1.Interface is a collection of DataMembers and Member Functions .But We cannot implement that DataMember and Member Functions .
1.Abstract class we can implement it .
Modifiers :
2. In Default interface contains public modifiers
2.But in abstract we can use private ,public modifiers
Inherit :
3.In interface we can inherit more than one interface in a class .
3. In abstract class we can inherit only one abstract class .
Methods;
4. All methods must be implemented ,otherwise we got an error message.
4. Need not be implement all decalre methods .
Comments
Post a Comment