---
title: "When to use Interface over abstract class?"  
description: "When to use Interface over abstract class?"  
author: "Anonymous User"  
published: 2012-05-12  
updated: 2020-09-15  
canonical: https://www.mindstick.com/interview/1442/when-to-use-interface-over-abstract-class  
category: "oops"  
tags: ["oops"]  
reading_time: 2 minutes  

---

# When to use Interface over abstract class?

Abstract Classes: Classes which cannot be instantiated. This means one cannot make a object of this class or in other way cannot create object by saying ClassAbs abs = new ClassAbs(); where ClassAbs is abstract class.\
Abstract classes contains have one or more abstarct methods, ie method body only no implementation.\
Interfaces: These are same as abstract classes only difference is we can only define method definition and no implementation.\
When to use wot depends on various reasons. One being design choice.\
One reason for using abstarct classes is we can code common\
functionality and force our developer to use it. I can have a complete\
class but I can still mark the class as abstract.\
Developing by interface helps in object based communication.

## Answers

### Answer by Anonymous User

Abstract Classes: Classes which cannot be instantiated. This means one cannot make a object of this class or in other way cannot create object by saying ClassAbs abs = new ClassAbs(); where ClassAbs is abstract class.\
Abstract classes contains have one or more abstarct methods, ie method body only no implementation.\
Interfaces: These are same as abstract classes only difference is we can only define method definition and no implementation.\
When to use wot depends on various reasons. One being design choice.\
One reason for using abstarct classes is we can code common\
functionality and force our developer to use it. I can have a complete\
class but I can still mark the class as abstract.\
Developing by interface helps in object based communication.


---

Original Source: https://www.mindstick.com/interview/1442/when-to-use-interface-over-abstract-class

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
