#66 Need of Interface in Java

Поділитися
Вставка
  • Опубліковано 7 вер 2024
  • Check out our courses:
    Enterprise Java Spring Microservices: go.telusko.com...
    Coupon: TELUSKO10 (10% Discount)
    Master Java Spring Development : bit.ly/java-sp...
    Coupon: TELUSKO20 (20% Discount)
    Udemy Courses:
    Java:- bit.ly/JavaUde...
    Spring:- bit.ly/SpringU...
    Java For Programmers:- bit.ly/javaPro...
    For More Queries WhatsApp or Call on : +919008963671
    website : courses.telusk...
    In this lecture we will learn:
    - Methods in java
    - What is an interface?
    - Need for an interface
    #1
    - We can also pass an object as a parameter in a method.
    - When you build an application, you need to make it more flexible.
    - We can create a reference of the parent class and an object of the sub-class.
    - Passing reference and the reference of an object that you accept in a method, both should be the same.
    #2
    Interface:-
    - Interface in Java is used to achieve abstraction.
    - Interface is used to design an application to make it loosely coupled.
    - implements keyword is used with a class to extend it to an interface
    interface Computer
    {
    }
    .........
    class Desktop implements Computer
    {
    statement;
    }
    #3
    Need of an Interface:-
    - It is used to implement abstraction.
    - We can also achieve multiple inheritance in Java, by using the interface.
    - Any class can extend only 1 class but can any class implement an infinite number of interface.
    - It is also used to achieve loose coupling.
    Github repo : github.com/nav...
    Java:- bit.ly/JavaUde...
    Spring:- bit.ly/SpringU...
    More Learning :
    Java :- bit.ly/3x6rr0N
    Python :- bit.ly/3GRc7JX
    Django :- bit.ly/3MmoJK6
    JavaScript :- bit.ly/3tiAlHo
    Node JS :- bit.ly/3GT4liq
    Rest Api :-bit.ly/3MjhZwt
    Servlet :- bit.ly/3Q7eA7k
    Spring Framework :- bit.ly/3xi7buh
    Design Patterns in Java :- bit.ly/3MocXiq
    Docker :- bit.ly/3xjWzLA
    Blockchain Tutorial :- bit.ly/3NSbOkc
    Corda Tutorial:- bit.ly/3thbUKa
    Hyperledger Fabric :- bit.ly/38RZCRB
    NoSQL Tutorial :- bit.ly/3aJpRuc
    Mysql Tutorial :- bit.ly/3thpr4L
    Data Structures using Java :- bit.ly/3MuJa7S
    Git Tutorial :- bit.ly/3NXyCPu
    Donation:
    PayPal Id : navinreddy20
    www.telusko.com

КОМЕНТАРІ • 57