So the only difference between interface and an abstract class is that you can't encapsulate them and can't use properties in them? | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
0

So the only difference between interface and an abstract class is that you can't encapsulate them and can't use properties in them?

3rd May 2016, 5:51 PM
Tomasz Grochowski
Tomasz Grochowski - avatar
2 Respostas
+ 8
There are technical differences between Abstract Classes and Interfaces, that being an Abstract Class can contain implementation of methods, fields, constructors, etc, while an Interface only contains method and property prototypes. A class can implement multiple interfaces, but it can only inherit one class (abstract or otherwise). Basically, an Interface defines what something can do (how it behaves), and an Abstract Class defines what something is.
20th May 2016, 2:23 PM
James Flanders
0
abstract is a class but interface is not a class
16th Jun 2016, 6:17 AM
sajjad
sajjad - avatar