DEV Community

velvizhi Muthu
velvizhi Muthu

Posted on

Module 3: Interface

  1. What is an Interface?

A set of rules for classes to follow, without providing the actual implementation of those rules.

Interface is a keyword.

Without a method definition that time we need to mention the "abstract" keyword.

We called the interface class, that time, no need to mention the "abstract" keyword in rules method.

We can mention the Non-abstract method but no need to mention the open brace and close brace.

We can't create the Object in the main method.

Key word: Implements
Implements is a Java keyword.

No need to called the abstract keyword in class and main method. Already automatically "abstract "keyword available in class and main method because hide the "abstract" keyword.

02.Why we use the interface in java?
We can hide the implementation details and just expose the method signatures.

Top comments (0)