Interface is a keyword of Java language that create block to hold constant and abstract methods.
Whenever any variable or object is declared in interface block then its necessary to initialize the value of that variable or object such declared variable or object is known as constant of interface block.
Whenever any proto type of method (signature of method) declared in interface block then that method becomes the abstract method from the interface block and it is necessary for the subclass to implement the body of obstruct method declare in the super interface body of abstract method should have public access specified.
Rules to Create interface
- It should not contain any body of method.
- It should not contain constructor.
- Uninitialized variable are not allowed in interface.
- We can not directly create the object of interface using new operator.