Differences between abstract class and Interface is as below:-
Implementation - In Abstract class some methods in abstract classes can have implementation and In Interface all methods, function, properties in interfaces have to empty compulsorily.
Scenario- In Abstract class abstract classes are used when we want to share common functionality in parent child relationship and In Interface - Interfaces are used to define contract, enforce standardization, decoupling and dynamic polymorphism.
Variable declaration- In Abstract class we can declare variables and In Interface we cannot do that.
Inheritance vs Implementation-Abstract classes are inherited and Interface are implemented.
Watch video on regular expression with practical demonstration as follows: -
Get more materials on important Dotnet interview questions
Regards,
See more stuffs on author’s blog for Most asked Dotnet interview questions
Implementation - In Abstract class some methods in abstract classes can have implementation and In Interface all methods, function, properties in interfaces have to empty compulsorily.
Scenario- In Abstract class abstract classes are used when we want to share common functionality in parent child relationship and In Interface - Interfaces are used to define contract, enforce standardization, decoupling and dynamic polymorphism.
Variable declaration- In Abstract class we can declare variables and In Interface we cannot do that.
Inheritance vs Implementation-Abstract classes are inherited and Interface are implemented.
Watch video on regular expression with practical demonstration as follows: -
Get more materials on important Dotnet interview questions
Regards,
See more stuffs on author’s blog for Most asked Dotnet interview questions
No comments:
Post a Comment