Hi!
I'm new, sorry if this is in the wrong place, mods please move this if necessary.
Basically, I'm trying to give a breif definition of interfaces and abstract classes, please check if these are right:
An interface defines what should be done not how it should be done. The interface class contains only methods and these methods have no concrete implementations – this is left to the classes that implement the interface. Each of the methods in the interface must be implemented in any class that implements the interface. Interfaces provide a kind of multiple inheritance because while a class can have only one superclass i.e. only one class can be extended (i.e. ‘extends’ keyword only used once), many interfaces can be implemented (by using the ‘implements’ keyword before each interface).
An abstract class provides a set of default behaviours that are available to its subclasses. Each of these default behaviours are defined in methods that are abstract, it is then left to the subclasses to give their own specialized implementations of these methods but every abstract method must be implemented in the subclasses. An abstract class does not have to have abstract methods but if a method in a class is declared abstract then the whole class must be declared abstract. Abstract classes cannot be instantiated.
Also, I'm kind of confused about when to use an interface and when to use an abstract class.
Thanks!