Interfaces in Java
- 18th Jul 2015
- 1
- 15246
- significance of using interfaces in java with an example what is interface in java why do we need interface
Interfaces It is one of the ways to achieve abstraction in Java. It will have only method declaration(abstract methods) and constant attributes in it. It cannot be instantiated like how we can’t instantiate abstract class. They are used to achieve multiple inheritance and polymorphism. Java interface Example public interface Hello{ String str = ”hello”; void […]