Interface in Java - Complete Explanation in-depth

Опубликовано: 13 Апрель 2026
на канале: Learn Java
222
7

You can learn Java with me as the Java Programming language is being made easily. It would take a period of minimum three months and maximum 6 months to master Java. I would recommend you to watch all my videos to crack any software interviews that would require Java Programming language as a primary skill.

Interfaces in Java:-
=====================
Interface in a java is used to achieve 100% abstraction.

Points to remember:-
==================

--An interface in java can have only abstract methods.

-- All the methods placed inside the interface are public and abstract by default.

-- You can't instantiate a java interface.(You cant create an object for the java inteface)

-- You can assign a reference variable for an interfaces.

-- A class can make is-a relationship with an interface by using implements keyword.

-- Once the relationship is made, the class has to provide the implementation for all the abstract methods that are inside the interface

-- You can create the object for the class and assign it to the interface reference variables

-- Please be informed that all the variables that is getting defined in an interface is public static final by default.

-- You can't have constructors inside an interface because all the variables are public static final by default.

-- You can't have static methods or final methods inside the interface.

=========================================================================