Interface in Java : 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.
- It is used to achieve abstraction and multiple inheritance in Java.
- It cannot have a method body.
- It cannot be instantiated just like the abstract class.
- Since Java 8, we can have default and static methods in an interface.
- Since Java 9, we can have private methods in an interface.
Java Interface also represents the IS-A relationship.
What is Is-A-Relationship : Is-A relationship in Java means different relations between two or more classes.
Use of Interface :
- It is used to achieve total abstraction.
- Since java does not support multiple inheritances in the case of class, by using an interface it can achieve multiple inheritances.
- It is also used to achieve loose coupling.
What is Loose coupling ?
Loose coupling in Java means that the classes are independent of each other.
🔰For Complete Core Java 👇👇👇👇👇👇
• Java Tutorial in Hindi
🔰 What is inheritance :
• Single inheritance program in java | ...
🔰 What is Upcasting :
• what is upcasting | upcasting in java...
🔔 Subscribe My Channel : @codeash
🔰 Follow my Social Media Platforms :
🏷Facebook :
/ codeash
🏷Instagram :
/ codeash_learningguru
🏷YouTube :
/ codeash
🏷Telegram :
https://bit.ly/3MNQxYB
🌐 Website :
www.codeash.com
✅ Whatsapp Us
https://wa.link/r6n3p3
interface in java, use of interface in java, interface in oops, interface in oops java, interface in java in hindi, interface in hindi, is-a relationship java, loose coupling in java
#interface #interfaceinjava #useofinterfaceinjava #is-arelationshipjava #loosecouplinginjava
Auf dieser Seite können Sie das Online-Video Interface in java | use of interface in java | is-a relationship java mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer codeash 03 Mai 2022 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 395 Mal angesehen und es wurde von 15 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!