Tell me the scenario,Where we can use interfaces or
Abstract class.And What is the difference between
interfaces and abstract class?
Answer Posted / vishal
Abstract Class encapsulates shared(common) behavior and
define place holder for all subclasses
- Define shared behavior
- Can have implementation code
- Can not be instantiated
- A class can be inherited from single abstract
class—Unless language supports Multiple inheritance.
- Provide both abstract and concrete menthods
- Strict IS-A relationship.
Interface: If there is no shared behavior –each subclass
must implement all method defines in a base class this is
called as Interface
- Defines Behavior. It is a cntract and its subclass
must implement it.
- Can not be instantiated
- A class can implemet mutiple interfaces
- Provide only abstract methods
- Not a strict IS-A relationship
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Why do we use class in oops?
• What are the desirable attributes for memory managment?
What is the importance of oop?
What is object in oops?
How do you explain polymorphism?
program for insertion ,deletion,sorting in double link list
What is inheritance in simple words?
Are polymorphisms mutations?
i am getting an of the type can not convert int to int *. to overcome this problem what we should do?
Whats oop mean?
How can you overcome the diamond problem in inheritance?
What is encapsulation in simple terms?
What is oops concept with example?
How do you achieve polymorphism?
What is polymorphism programming?