8.22 Interface in Java 8 Default , Static Methods | New features

Поделиться
HTML-код
  • Опубликовано: 8 сен 2024

Комментарии • 524

  • @fernandomora1963
    @fernandomora1963 5 лет назад +228

    I watched two hours of Navin's tutorials and I'm just trying to get a refresher on Java. I'm so upset that he wasn't around the years when i was learning Java. If you are starting to learn Java and come across Navin's playlist... it's like you've discovered a gold mine. Now i'm basically watching the rest of his tutorials because he's so clear and fun to watch.

    • @bhavik.kothari
      @bhavik.kothari 4 года назад +1

      I totally agree

    • @nithyashreenaidu8357
      @nithyashreenaidu8357 4 года назад

      yeah he is diamond

    • @sanketdhamala8456
      @sanketdhamala8456 4 года назад

      @@bhavik.kothari Totally agreed. Alot of videos on programming are either extremely boring to listen to or they're not as concise. Thank you Navin

    • @universalstarcreations7297
      @universalstarcreations7297 3 года назад

      But these videos are of older versions of Java. Many advancements took place in these days. If those advancements are too covered it'll be more helpful for the fresher's now

    • @jesseduncan1140
      @jesseduncan1140 3 года назад

      I dont mean to be off topic but does someone know of a tool to get back into an instagram account?
      I somehow forgot my login password. I would appreciate any tips you can offer me.

  • @AmitKumaarrr
    @AmitKumaarrr 6 лет назад +19

    The way you have explained I have never seen such an easy tutorial about basics of Lambda express in Java.

  • @premkumareaswaran6875
    @premkumareaswaran6875 4 года назад +12

    Thanks for this amazing tutorial Navin. You are saviour. Just would to add something. If there are two interfaces which define the same method (Ex: show()), then the class that implements these two interfaces does not always have to define the same method. Instead, it can use the "super" keyword like below which will also work.
    .super.show();
    Nonetheless, thanks a lot once again. You are an amazing teacher.

    • @saurav0203srivastav
      @saurav0203srivastav Год назад

      Hi Prem, actually in this case you have to define the show() method in your class and then you can choose to call show() method in your definition by using InterfaceName.super.show();

  • @adriano.santana
    @adriano.santana 5 лет назад +9

    Been trying to learn Java through books, udemy courses, articles, and so far you're the best teacher I've found. Thanks,really. I've been stuck with some subjects like interfaces and your videos are clearing my doubts.

  • @JayPatel12928
    @JayPatel12928 6 лет назад +26

    This is a gold quality information, take a bow Navin! I know this because I have been here for a while now and having worked with Java for 5ish years, I have rarely found such good quality videos. Pure Gold!

  • @watchb4udie398
    @watchb4udie398 3 года назад +5

    it was nice listening so for and thank you for putting your effort in teaching us.

  • @himanshidhamija9524
    @himanshidhamija9524 4 года назад +2

    I am watching this years later and still so relevant,its such a great quality content. I have not found anyone explaining java and making is to easy to understand and learn.Thank you for your hard work sir. Its really helpful

  • @subashchokkalingam6312
    @subashchokkalingam6312 4 года назад +1

    I was watching your videos past 3 days. i was really immpressed and appreciate your efforts to explaining the difficult concept iin the simple way. I was quit out of IT industry (exp 14 years) around 4 years back and starting doing business in the different verticle (Non-IT) but after seeing your videos got an interest to work again in IT and come back to work in Java with latest technologies.Since you are there for me to give technologies in the simplest way. I recalled all my 14 years of experience in 2 days. Really appreciate for your effort on this. Salute to Naveen. Thanks Subash C

  • @elamurugup352
    @elamurugup352 3 года назад +5

    Thanks for this session Naveen. Jsut want to be more clear,Could you exactly differentiate the difference between abstract class and interface since both are defining methods in java 8?

  • @SajeelBongale
    @SajeelBongale 3 года назад +1

    This is the most comprehensive video I have ever seen on default and static keywords. So many details listed out with such a simple and evenly paced delivery! You, sir, are simply amazing!

  • @priyadarshiniMG
    @priyadarshiniMG 2 месяца назад

    Very well explained the concepts and difference between the interface and abstract class with perfect example and explanation in an easy way. Thq so much dear👍👏🤗

  • @prameelabanda1568
    @prameelabanda1568 6 лет назад +29

    HI Navin,
    I kept watching and learning through your tutorials. Your way of teaching is good.
    My only suggestion is , please use real world example for every concepts which helps to understand quick and remember the concepts for long go :)

  • @prashantshekharrathore4661
    @prashantshekharrathore4661 2 года назад

    Sir I cant stop watching your videos....I open laptop to learn some DSA and end up watching your videos one by one. Damn Naveen sir your are awesome. God bless you. :D

  • @jitheshss90
    @jitheshss90 2 года назад

    Perfect tutorial. If anybody has to know about the Default Method in java 8. Please go through this video and I recommend this.

  • @rasul_dude
    @rasul_dude 4 года назад +1

    Your tutorial is not so long and also not so short. Your tutorial are really perfect

  • @sneha_d_mystery_princess
    @sneha_d_mystery_princess 5 лет назад

    Navin sir... I must say... ur explanation is too good... u make things easy... by taking the exact appropriate cases... Thank you so much...

  • @naveenkondamuri4946
    @naveenkondamuri4946 2 года назад +1

    Thank you so much Navin for the wonderful explanation. If possible, please provide sessions on Spring Batch, and Microservices.

  • @Spider-Man_67
    @Spider-Man_67 4 года назад +1

    Thank a lot sir for explaining it in a pretty simple way.

  • @6977202865
    @6977202865 5 лет назад +2

    your making everything dead easy to be understood with your explanations!!! you are amazing!! thank you very very much!!!!

  • @nagapradeepvankayala7301
    @nagapradeepvankayala7301 2 года назад

    Navin is Awesome, no matter how long the video size is, my same interest levels would continue throughout the video from starting till ending, excellent explanation skills he has...Yes, Navin is a Gold mine, Diamond, and even more than that. We are all so lucky to have him. Love you brother :), I wish God bless you with lots of energy, skills, and continued enthusiasm towards sharing knowledge like this

  • @sebastiancapone3284
    @sebastiancapone3284 5 лет назад +1

    I have looked at several tutorials ... I consider myself a perfectionist and I like to learn, not only to know a programming language from above without going into the details. By your way of explaining I can see the passion you give to your videos and when I look at them, I have the security of learning, because you go to the smallest detail. You are very perfectionist and this is really appreciated ... There is no other course, which has caught me like this ... I really appreciate it.

  • @jaserq
    @jaserq 4 года назад +2

    He is the best with his style.! And his signature is "HI ALIENS" :)

  • @swaminaidu9454
    @swaminaidu9454 4 года назад

    You are the reason behind my earning in software field.thanks a ton.keep doing videos for geeks like me.Waiting for more videos

  • @shivaramkrishnadurgi4253
    @shivaramkrishnadurgi4253 3 года назад

    Amazing teaching Naveen reddy...so crystal clear...

  • @tranhai5146
    @tranhai5146 3 года назад

    Your Java 8 - Interface lession is perfect.

  • @Harsh_r_mh09
    @Harsh_r_mh09 3 года назад +1

    Great level of teaching!

  • @ankitsaxenamusic
    @ankitsaxenamusic 7 лет назад +2

    You're amazing.. Hats off to you Naveen. No book can describe with such an ease. Kudos.. Keep on posting more videos :)

  • @parth191079
    @parth191079 7 лет назад +30

    Hi Navin,
    I became your fan and a "chela" after this video! Awesome work, sir! Thanks a lot!!

    • @sureshsharma1808
      @sureshsharma1808 7 лет назад +1

      Yes. same here. He doesn't create complexity and very centric to make other understand. Great Job Sir.

    • @SirThanksalot_1
      @SirThanksalot_1 5 лет назад

      did somebody say 'Thanksalot'?

  • @himanshushekhar8551
    @himanshushekhar8551 7 лет назад +2

    u r such a amazing teacher sir..you have clear my all concept..thank you sir..

  • @truptigandhi891
    @truptigandhi891 4 года назад

    U made this concept so easy.....👍👍

  • @gunavanthamgowda669
    @gunavanthamgowda669 5 месяцев назад +1

    Hi Sir, I love the way you explain, at last you told we can access static method of the interface n main like (I.show()) method without creating object of interface I. But is it mandatory to implement the interface? could you please elaborate static methods.

  • @rajendralella6956
    @rajendralella6956 4 года назад

    Very well explained with examples, simply brilliant

  • @sumanjogi614
    @sumanjogi614 3 года назад

    It feels so good to learn from you!! I have no words to explain it. Others will understand for sure!!!

  • @khadarzone
    @khadarzone 7 лет назад +1

    Good one Navin... Very helpful in understanding java 8 concepts..

  • @vijaykumarreddyt3287
    @vijaykumarreddyt3287 Год назад

    Navin Reddy, You teach Great

  • @vivekmerugu6711
    @vivekmerugu6711 4 года назад

    Your are explaining the concepts very beautifully and with ease. The way you explained the concepts with real time examples are really awesome.

  • @kalyankumargudla6027
    @kalyankumargudla6027 4 года назад +2

    Thanks you for you videos .
    Have question
    When our class ‘C’ implement ‘I’ and ‘J’ as you said we should override the common method to avoid errors .
    When we use third party libraries , if our class implement two interfaces if both having same method in there interfaces as per tutorial we should override common method , but here we don’t know the business logic of interfaces common method .
    Could you pls explain this

  • @deeps2111
    @deeps2111 3 года назад

    Very well explained. Thanks Navin

  • @chaturadedigamuwa969
    @chaturadedigamuwa969 2 года назад

    Navin is the best guy to learn java. Thank you so much

  • @mukulsharma2339
    @mukulsharma2339 8 лет назад +3

    Hello, It was nicely explained and I got the knowledge to use default and static keywords. I have few questions here now,
    Q1- What is the significance for using default keyword while we already having Abstract class for the same?
    Q2- What are the differences between static and default keyword?
    Thanks for your time.

  • @sasmitamoharana39
    @sasmitamoharana39 5 лет назад +6

    Hi Navin,
    Thank you and nicely you explained, I have one doubt, what is the difference between abstract class and interface in Java 1.8?

    • @logic_master950
      @logic_master950 5 лет назад

      Interface only built with abstract methods(pure virtual functions). No defined method allowed in interface.

    • @logic_master950
      @logic_master950 5 лет назад

      Interface only can have abstract method

    • @DR-pi9vk
      @DR-pi9vk 4 года назад

      @@logic_master950 But that s not true anymore since 1.8. That s what he explained in this video. I still dont see a difference now between those two classes

    • @logic_master950
      @logic_master950 4 года назад

      @@DR-pi9vk thanks a lot , dear

  • @deepanshubabbar9324
    @deepanshubabbar9324 3 года назад

    Thanks a lot naveen reddy for these tutorials. You are one of my favourites when it comes to programming tutorials. The tutorials are perfect.

  • @meena7222
    @meena7222 2 года назад

    The mention of function declarations in C was helpful.

  • @007ayansinha
    @007ayansinha 5 лет назад +9

    I just love the way he starts with the word “welcome back aliens” 🤓

  • @aashishkumarchauhan8057
    @aashishkumarchauhan8057 5 лет назад +4

    Hi Navin,
    Thanks for explaining in such a good way. I have one doubt about both abstract class and interface can have methods with implementation in Java 8. Then what is difference between both ?
    Where should we use abstract class and where we can go with interfaces ?

    • @justforjava192
      @justforjava192 4 года назад

      You obviously can define methods in an interface, but it isn't *designed* for that. Do it if you have no other choice, (just like List did it for backward compatibility). Interfaces are designed for 100% abstraction. They, moreover don't tell what your class *is, but rather, what it can do (which is why we name them with an adjective rather than a noun).* Realize an interface doesn't affect its implementor much. You could easily retrofit your class to implement or unimpliment an interface, without changing the existing implementation (even if it's already a subclass, due to multiple inheritance). This is impossible with an abstract class, as their subclasses hugely rely on them. Hence, when you have to implement methods, and your subclasses rely on their parent's implementation, choose an abstract class. Else if you wanna just define the behavior of a class, choose an interface.

    • @prashantaarya3852
      @prashantaarya3852 4 года назад

      No doubt video is helpful but not complete. For that we can use show(){A.super.show(); B.super.show();} whichever implementation you can call.

    • @divyad9144
      @divyad9144 2 года назад

      When we doesn't know any implementation at all, we only have requirement specification then in such cases we go for interface. And when we know implementation but not completely (partial implementation) then we go for abstract class

  • @kartheek.g3667
    @kartheek.g3667 8 лет назад +3

    thank's with this vedio I got some idea of interface

  • @shashgo
    @shashgo 7 лет назад +1

    Navin, So I understand that up until 1.7, we can do multiple inheritance with interfaces because interfaces dont implement methods. And Im assuming that the answer to why we cannot inherit from mutiple classes, even if the classes are abstract is that these abstract classes CAN all implement the same methods. Coming to Java 1.8, what is the benefit of making it possible to implement methods in interfaces? If we can inherit from multiple interfaces that all implement the same methods, and then have to implement the method again in the child class, then what is the benefit. We have to implement the same method thrice. Also this is like inheriting from multiple classes, so what is the reason for this new interface definition?

  • @bhavyakumarpanchotiya8254
    @bhavyakumarpanchotiya8254 4 года назад

    Good Video sir and thanks for provide some information related to java 8

  • @sindhusudhakaran1731
    @sindhusudhakaran1731 3 года назад

    Thank you so much Navin for this video .. it's very helpful

  • @romanmotovilov129
    @romanmotovilov129 4 года назад +1

    Thank you, sir, for a good lesson!!!

  • @alpesh003
    @alpesh003 3 года назад

    🙏 This is awesome! Please dont stop. Hope it benefits you a lot.

  • @anuragverma9519
    @anuragverma9519 6 лет назад +4

    great explanation for interview

  • @amitghosh6199
    @amitghosh6199 3 года назад +2

    can you explain the purpose of Abstract class in java8 when we have interface with default method. would appreciate if you comment or create a video on this. Thanks for providing awesome learning experience for all of us.

    • @scars707
      @scars707 Год назад

      and why do we need to implement and make our own method in the class c ?

  • @themodestai9603
    @themodestai9603 3 года назад

    Best teacher ever!

  • @dexterdenmark5988
    @dexterdenmark5988 4 года назад

    I like this lecture Very much! Thank you !

  • @arpitanand6534
    @arpitanand6534 4 года назад

    You rock Navin, I am your fan

  • @AnshumanSharmadev
    @AnshumanSharmadev 3 года назад

    Wow! Amazing! Loved it! Thank you!

  • @bodduanilkumar7783
    @bodduanilkumar7783 5 лет назад

    Hi Navin sir,
    Example u explained using third rule is always calling first interface rather than the class which is extended

  • @MD-ew1xg
    @MD-ew1xg 4 года назад

    Great explanation !

  • @priyagawai6963
    @priyagawai6963 3 года назад

    Thank you sir, it's really helpful. Very well explained.

  • @hetalrachh5665
    @hetalrachh5665 4 года назад

    Really useful content !! Thanks for your videos.

  • @prasadbojanapu5093
    @prasadbojanapu5093 8 лет назад +1

    Its so good for us, please explain all new features in java 8, if it is having more.

  • @Efocusto
    @Efocusto 3 года назад

    wonderful work big like

  • @ajaydhiman2368
    @ajaydhiman2368 4 года назад

    want to add 1 point here, If class C implements both the Interface I & J then its not necessary for class C to give the definition of static method (provided you are not calling it in your class C) but its necessary to for class C to give the definition of default methods (even though your are not calling it in your class C)

  • @anirudhgahlot6361
    @anirudhgahlot6361 5 лет назад

    Excellent session, cleared many concepts.

  • @sreelekhapola8813
    @sreelekhapola8813 3 года назад

    In this you explained like when we have two interface with same method , in that case we have to override that method in the class. after that i didn't understood are we calling the implement methods or what we are doing after overriding

  • @NarendraKumarAchari
    @NarendraKumarAchari 8 лет назад

    Thanks a lot Naveen for your effort to create all these Video - Hats off

  • @erikmueller5622
    @erikmueller5622 5 лет назад

    An interface is a way of grouping classes. The reason for this is that any class that implements that interface must "do" all the methods that are written in that interface. So if there is an interface called "animal" which has methods: eat, sleep, walk, run, jump, then we have a bunch of classes for different types of animals, we would "group" all the different animal classes together by making them all implement the interface which means they must all "do" the methods in the interface, because those methods are common to them all. If that sounds exactly like inheritance with an abstract parent class that's because it is. The reason that an interfaces are used instead of regular abstract class inheritance is because in Java a class can only have one parent class but can many interfaces interfaces. If a class could have multiple parent classes then there would be no point in interfaces.

  • @rubanprakash8088
    @rubanprakash8088 7 лет назад

    Hi Naveen you are just awesome... god bless you and keep uploading videos it really helps me. thanks a lot.

  • @foxhound4829
    @foxhound4829 8 лет назад

    Very cool explanation with some very good examples. Keep it up!

  • @craftyrouze
    @craftyrouze 2 года назад

    Thank you for a very good explanation. I have been using default methods a lot, but never occured to me there are limitations

  • @mayonaise4071
    @mayonaise4071 6 лет назад +1

    now i get it , thanks a lot , and were getting older navin :)

  • @_Nikhil_Bagde_
    @_Nikhil_Bagde_ 8 лет назад

    Nice work. Clear and useful videos

  • @rohitspeaksout
    @rohitspeaksout 4 года назад

    interfaces have been turned into abstract classes essentially.
    C++ never had interfaces and allowed for multiple inheritance with methods of conflict resolution in diamond problems.
    I think Java can get rid of interfaces altogether may be via small steps such as Java 8 to remain backward compatible.
    Great tutorial though :)

  • @GoutamSikder
    @GoutamSikder 5 лет назад

    Very Nice explanation.

  • @rajkapoor944
    @rajkapoor944 4 года назад

    really good man - highly rate your great explanation. Thanks

  • @vijayakumarvj
    @vijayakumarvj 6 лет назад

    excellent video, pretty clear.. I don't know why 28 dislikes

  • @apurvavyas1016
    @apurvavyas1016 7 лет назад

    Thanks a lot its really help to understand the concept of java 1.8 default and static method

  • @bksolvent1
    @bksolvent1 8 лет назад

    Good work Mr Naveen Sir

  • @half-blood-prince
    @half-blood-prince 6 лет назад

    Your way of explaining things, and sentence construction is great bro.
    keep up the good work.

  • @princevijaypratap6025
    @princevijaypratap6025 6 лет назад

    sir u have explained very well that why we should have a default method in java 1.8 interface but please can u elaborate the significance of having the static method in interface too with any real time scenario or example like u have explained for default one because I don't see any practical requirement of doing that.

  • @padamdhariwal3456
    @padamdhariwal3456 7 лет назад

    Very nicely explained. Thanks.

  • @meatballstasteok8844
    @meatballstasteok8844 4 года назад

    Thank you, beautiful explanation

  • @rovsenhuseynov8368
    @rovsenhuseynov8368 4 года назад

    Great explanation, valuable info. Thank you Navin!

  • @rtheame4704
    @rtheame4704 3 года назад

    Really explained well. Thank You. Can we use super keyword to solve default methods diamond problem

  • @varunsharma264
    @varunsharma264 4 года назад

    Sir! Your Tutorials are really helpful. Thanks

    • @FaycalAZIB
      @FaycalAZIB 4 года назад

      check my course about java 8 :)

  • @AmbujRajput
    @AmbujRajput 6 лет назад

    One of the best video of your channel. Thanks :)

  • @balramkewat9576
    @balramkewat9576 3 года назад

    11:14if we implement both interface in one class .. 11:15 define the show(); in Class C,
    then which method should call??
    class C method, or interface I's method or interface J's method

  • @warneyfied
    @warneyfied 3 года назад

    Great tutorial. Thank you so much!

  • @cmcatholic1798
    @cmcatholic1798 4 года назад

    On overriding a method in main class which is alerady defined in those 2 interfaces (which are not an abstract method, duh!) Then we will get , what's inside the overridden method on calling that method . So no need to implement same signature method in two interfaces cuz it will ultimately show the overridden one

  • @elevatelifebyshravani7498
    @elevatelifebyshravani7498 3 года назад

    Woow thank you so much.....u cleared my confusions

  • @sowmyapagidimarri500
    @sowmyapagidimarri500 3 года назад

    Brilliant explanation

  • @atiqulny
    @atiqulny 4 года назад

    Very well explained. Thank you!

  • @deep80105
    @deep80105 5 лет назад +2

    Explanation to the point and in-depth. Amazing

  • @priyeshprince2318
    @priyeshprince2318 5 лет назад +1

    Two interfaces are there which have same functions signature and different definitions . A class is implementing both interfaces then which method is called class 1 or class 2

  • @neetigupta5468
    @neetigupta5468 5 лет назад +1

    loved it . Thanks Navin

  • @dhivakars4583
    @dhivakars4583 6 лет назад

    Clear Explanation.. Thanks !!

  • @pradnyapotdar7768
    @pradnyapotdar7768 6 лет назад +1

    Hi Navin. Thanks for info. But can we add static main method in interface. If yes then how to execute it ?

  • @indranilgoswami1500
    @indranilgoswami1500 7 лет назад

    Excellent explanation sir

  • @nishant5519
    @nishant5519 6 лет назад +5

    At 3.10 you said stream() method is introduced in List interface from Java 1.8
    I think this is wrong. There is nothing like stream() method in List interface

    • @rubybaksh2234
      @rubybaksh2234 4 года назад

      We have stream() in Collection interface in java 8