interface in java | Java Tutorial
This Java Tutorial “interface in java” page is providing introduction to interfaces including definition, functionality and about implements keyword in java application.
- Complete definition of Object(100%)
- (Only Concrete methods are allowed)
- Partial definition of Object(…..%)
- (Both Concrete & Abstract methods are allowed)
- Complete specification(declaration) of Object (0%)
- (Only abstract methods are allowed)
- ‘interface’ is a pre-defined modifier is used to define set of specifications.
- ‘interface’ definition allows only abstract methods.
interface not allow non static concrete methods
// Error : interface methods can't have body
- By default interface methods are “public & abstract”
void f1() ; // by default public & abstract
void f2() ;
- We can check compiler added code as follows: