Interview Preparation: Interfaces
8 BRILLIANT ANSWERS TO SOFTWARE ENGINEERING INTERVIEW QUESTIONS! 👍 Q 1. What is an interface in Java and why would you, as a software developer, use interfaces? a) Interface in java An Interface in the Java programming language is defined as an abstract type that is used to specify the behavior of the class. In java, interface is a blueprint of the behavior. The Java interface contains static constants and abstract methods. The interface in a Java is the mechanism to achieve abstraction. There can be only the abstract methods in Java interface, not a method body. It is used to achieve abstraction and multiple inheritance in java. In other words, we can say that the interfaces can have abstract methods and variables. It cannot have the method body. Java Interface also represents the IS-A relationship. When we decide the type of entity by its behavior and not through the attribute, we should define it as the interface. Like the class, int...