Give any criteria when you use an abstract class and an interface?
Answer / Anurag Choubey
1. Abstract Classes are used when you want to enforce a common behavior across all subclasses but also allow for implementation differences. They can contain both abstract and concrete methods. 2. Interfaces are used when you want to define a contract or set of methods that classes should implement, without providing any implementation. Multiple classes can implement the same interface.
| Is This Answer Correct ? | 0 Yes | 0 No |
Can I implement polymorphism using abstract class?
Can an interface inherit from another interface?
What is the difference between an error and an exception?
What is guard condition?
8 Answers Mannar Company, Syntel,
Why do we use oops concepts? What is its advantage?
Explain about the analysis phase?
How many instances can be created for an abstract class?
What is the benefit of Composition over Inheritance?
Explain the abstract class modifier?
what is the difference between the up phase and up workflows?
What is association?
What does the keyword virtual represented in the method definition?