Advance-Java Interface in Java #19

Publicado el: 21 marzo 2022
en el canal de: King of Techniques
134
3

#java #interface #KingofTechniques
‪@kingoftechniques6864‬

An Interface in Java programming language is defined as an abstract type used to specify the behavior of a class. An interface in Java is a blueprint of a class. A Java interface contains static constants and abstract methods.

An interface in Java is a blueprint of a class. It has static constants and abstract methods.

The interface in Java is a mechanism to achieve abstraction
There can be only abstract methods in the Java interface, not method body. It is used to achieve abstraction and multiple inheritance in Java

Why use Java interface?
There are mainly three reasons to use interface. They are given below.

It is used to achieve abstraction.
By interface, we can support the functionality of multiple inheritance.
It can be used to achieve loose coupling.


An interface is declared by using the interface keyword. It provides total abstraction; means all the methods in an interface are declared with the empty body, and all the fields are public, static and final by default. A class that implements an interface must implement all the methods declared in the interface.

interface [interface_name] {

// declare constant fields
// declare methods that abstract
// by default.
}


En esta página del sitio puede ver el video en línea Advance-Java Interface in Java #19 de Duración hora minuto segunda en buena calidad , que subió el usuario King of Techniques 21 marzo 2022, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 134 veces y le gustó 3 a los espectadores. Disfruta viendo!