- Software Architecture
- Design Pattern
- UI Designers
- Software Design
- Modeling
- Interface is used for this
- Languages
- Java IDL (Interface Definition Language)
- CORBA (Common Object Request Broker Architecture) => Component Based Reusable Items, Used in Networking
- Java RMI (Remote Method Invocation)
- Objective C, xcode => MVC (Model View Controller) => Model is interface.java, View is App.java, Controller is BusinessLogic.java
- Interface
- No implementation, Only Signature
implements
=> This keyword is used
- Properties/Fields are public, static, final
- Methods are public
- Multiple Inheritance allowed => A class can implement multiple Interfaces
- Inheritance for Interface
- Declaring a Interface, Can also declare default methods
public interface interfaceName {
// Abstract Method
void functionName(parameters);
// Default Method with Implementation
default void functionName(parameters) {
// Statements
}
}
- Extending a Interface, Methods will get overridden but will have their own initialization
interface interfaceName2 extends interfaceName1 {}
- Have to define all the methods of interfaceName in the Class
class ClassName implements interfaceName {
void functionName(parameters) {
// Statements
}
}
- Multiple Inheritance, Have to define all the methods of interfaceName1 & interfaceName2 in the Class
class ClassName implements interfaceName1, interfaceName2 {
// Statements
}
- Default Methods
- Static Methods
- Anonymous Inner Classes
- Functional Interface
- Lambda expression