#65 What is Interface in Java

Поділитися
Вставка
  • Опубліковано 27 лис 2024

КОМЕНТАРІ • 47

  • @DeeperRed-of1gp
    @DeeperRed-of1gp 7 місяців тому +10

    At 7:26 it is said that "we are doing implement not extends so only methods are available and variables are not available". Actually, regardless of what we do implementation of interface or extends of parent class, the variables also gets passed on in child. When we do Subclass obj = new Subclass(); we can see that variables are accessible. The thing with interface is that as the variables are final, so we can't change it. But it is available in child class! Maybe it was just Slip of tongue by Telusko!
    Enjoying the series so much! Thank you for posting it!❤

    • @DeeperRed-of1gp
      @DeeperRed-of1gp 7 місяців тому +2

      Actually according to GPT , In Java, static fields declared in interfaces are accessible through the implementing class, not inherited. When we access B.age in above example in main method, it's not due to inheritance, but rather because interface fields are implicitly public, static, and final.
      In our case, age is a static field of the A interface, which means it can be accessed using the interface name itself (A.age) or through any class that implements the interface (B.age).
      So, while it may seem like the field is inherited, it's actually being accessed through the interface.
      This behavior allows for constants and other shared data to be accessed consistently through the interface, regardless of the implementing class.

  • @jibonjibon8231
    @jibonjibon8231 Рік тому +11

    Your Process of explaining and the step by step developed example is just blowing my minds. Tomorrow is my java final exam. I have regrate that why I didn't follow you from before! Your teaching system is well pre-planed, clear.
    I have a request, plz don't stop making tutorial. Keep doing by this way of explaining. Need Python ,framework, Algorithm from you.

  • @thusith-tec307
    @thusith-tec307 Рік тому +34

    Today I subscribed you after watching this video. Your explanation and English pronouncing are better than others. I respect you my new Teacher ❤. Love from Sri Lanka

  • @rapidken
    @rapidken Рік тому +11

    Great playlist! There are some other videos in this course playlist that explain the terms used in this one. Feel free to give them a look if you're in need of a quick refresh!
    - Abstract and Anonymous class: ua-cam.com/video/4YnGBOyA2Q4/v-deo.html
    - Static Variable: ua-cam.com/video/7HYaQOyvw7Q/v-deo.html
    - Static variable Example: ua-cam.com/video/7HYaQOyvw7Q/v-deo.html
    - Heap: ua-cam.com/video/_GK3WoFFKUE/v-deo.html
    - Heap memory: ua-cam.com/video/cV-sOpOgof8/v-deo.html

  • @ramyapinapothu9901
    @ramyapinapothu9901 Рік тому +3

    Amezing explination everyone saying only theory u are the only one following practical manner ur having great explanation

  • @obaldalmeida6308
    @obaldalmeida6308 Рік тому +1

    I have been watching Navin sirs old vedios and found this gem ....good to know you are doing well....looking fresh sir ✨ with an upgrade

  • @Arsun-77
    @Arsun-77 29 днів тому

    Me videos lo examples tho concept inka baga ardm aythundi anna...❤

  • @daulitech219
    @daulitech219 8 місяців тому +1

    I read Interface through a book but I couldn't understand it, until I found your video. Thanks

  • @mangaraj45
    @mangaraj45 5 місяців тому +30

    That's not my age 💀🌚😅

  • @projyoti7489
    @projyoti7489 6 місяців тому

    What a type of teaching skills ! Mind-blowing

  • @adityasrinivas3069
    @adityasrinivas3069 4 місяці тому +1

    Video #66. and #65 should be interchanged, i.e, explain what is an interface and then explain why it is important. It will be easier to understand.

    • @Telusko
      @Telusko  4 місяці тому

      Thanks for the correction

  • @iqbalsingh3848
    @iqbalsingh3848 3 місяці тому

    your video just blow my mind.. its crazy ... thanks for a lot of information...

  • @AmarGrg
    @AmarGrg Рік тому +4

    Hi @Telusko thank you very much for all those wonderful videos. Just started learning java and I am already learning alot. Have a quick question for you, while doing PHP we used to write interfaces for the model entity class, what do you think about it? what might be the pros and cons?

  • @rajeshwarijindam-dx3xz
    @rajeshwarijindam-dx3xz Рік тому +2

    Anna mi teaching baa super undhi

  • @manas332
    @manas332 4 місяці тому

    Excellent explanation

  • @chouaibakni2828
    @chouaibakni2828 16 днів тому

    Thanks

  • @Programing-lo3og
    @Programing-lo3og 6 місяців тому +1

    Thanks You Sir

  • @alwinvj6487
    @alwinvj6487 Рік тому +1

    Thanks for this video🤗

  • @sriemandi3978
    @sriemandi3978 11 місяців тому +1

    Merry Christmas Naveen bro

  • @raghavsood768
    @raghavsood768 Рік тому +2

    Notes:
    All variables inside interface are static and final

    • @mohamedmurshid9794
      @mohamedmurshid9794 Рік тому +1

      and public by default too. all the methods inside interface are public and abstract.

    • @mehakfatima6531
      @mehakfatima6531 Рік тому

      ​@@mohamedmurshid9794 well they have to be public so that the abstract methods inside it can be used further in derived classes or the whole point of creating a interface will be nothing

    • @mohamedmurshid9794
      @mohamedmurshid9794 Рік тому

      @@mehakfatima6531 yep true. But i just added those are public too. Not only static and final. Thank you for this comment.🤗

  • @roshanekka8293
    @roshanekka8293 9 місяців тому +1

    nice explanation

  • @Nothingtosaymore
    @Nothingtosaymore 6 місяців тому

    Thank you

  • @edgbaston149
    @edgbaston149 Рік тому +1

    Thank you so much

  • @adityamishra_11
    @adityamishra_11 10 місяців тому

    Are we take scanner (input) at the time of declaring any variables inside the interface.?

  • @Hemanth83439
    @Hemanth83439 Рік тому +2

    kollada mona 👌

  • @VishnuSai-u2e
    @VishnuSai-u2e Місяць тому

    Without out main() we can i print any statement?

  • @Ambitious675
    @Ambitious675 Рік тому +2

    Thank you so much sir :)

  • @srimantamondal8769
    @srimantamondal8769 Рік тому +3

    Can someone tell me why inside println(), "x:" is used. This variable "x" is not declared anywhere and is not giving any error. Also if it is not a variable then let me know what it is.

    • @santhosh-benz7
      @santhosh-benz7 Рік тому +5

      Here inside the println(), "x:" is used , it is provided by the IDE ( here VS code ) , which means it remains you to code here or pass the parameter , which makes you aware about the line of code . It needs some thing based on the code . I think you can Understand 😅

    • @shubhrajit2117
      @shubhrajit2117 5 місяців тому +1

      You can disable it by going to settings -> Java hints -> None

  • @filmbuzz9419
    @filmbuzz9419 5 місяців тому

    Can i implement another method in class B

  • @rohitgundam2275
    @rohitgundam2275 2 місяці тому

    How is he able to create an object A (since this has the same name as the interface?)

  • @hirenkansara77
    @hirenkansara77 3 дні тому

    👌👌👌👌👌

  • @sheikhnasir3437
    @sheikhnasir3437 4 місяці тому

    6:13 Funniest part 😂

  • @sushmithakn6003
    @sushmithakn6003 8 місяців тому

    Why this error come - failed to resolve main method code lens :inter faceis not a valid java identifier

  • @TochukwuVictor-qe4xd
    @TochukwuVictor-qe4xd 5 місяців тому

    ❤❤

  • @AbuIshaqAlShafii
    @AbuIshaqAlShafii 8 місяців тому

    5:12

  • @JulieJulie-x6t
    @JulieJulie-x6t 3 місяці тому

    🎉❤

  • @Hawkai-ro2hx
    @Hawkai-ro2hx 3 місяці тому

    That's not my age was personal

  • @abhi._77
    @abhi._77 Рік тому

    Nipora