Interfaces

Interfaces


I have always found interfaces to be a confusing topic. I usually tend to skip when learning about it. This blog post will improve understanding of Interfaces

What are Interfaces?
Interfaces only have methods without their implementation. Interfaces are implemented by classes to increase the scope of the class.

A class which implements an interface must implement all the methods in the interface else it becomes an abstract class

Uses of interfaces
1. Interface acts as guarantee that all methods asked will be implemented
2. If interface is a building, then the classes Bungalow, Skyscraper would implement methods in interface building

Comments

Popular posts from this blog