Java Anonymous Inner Classes Explained in 6 Minutes

Sdílet
Vložit
  • čas přidán 11. 07. 2021
  • Anonymous Inner Classes fully explained in just 6 minutes.
    We'll also explain what Anonymous Inner Classes have to do with Bigfoot...
    Anonymous inner classes can sound like a scary concept, but they're really pretty simple. We'll explain them in just a few minutes in this beginner Java tutorial video lesson.
    What do Anonymous Inner Classes in Java have to do with bigfoot? You're about to find out.
    Learn or improve your Java by watching it being coded live!
    Hi, I'm John! I'm a Lead Java Software Engineer and I've been in the programming industry for more than a decade. I love sharing what I've learned over the years in a way that's understandable for all levels of Java learners.
    Let me know what else you'd like to see!
    Links to any stuff in this description are affiliate links, so if you buy a product through those links I may earn a small commission.
    📕 THE best book to learn Java, Effective Java by Joshua Bloch
    amzn.to/36AfdUu
    📕 One of my favorite programming books, Clean Code by Robert Martin
    amzn.to/3GTPVhf
    🎧 Or get the audio version of Clean Code for FREE here with an Audible free trial
    www.audibletrial.com/johnclean...
    🖥️Standing desk brand I use for recording (get a code for $30 off through this link!)
    bit.ly/3QPNGko
    📹Phone I use for recording:
    amzn.to/3HepYJu
    🎙️Microphone I use (classy, I know):
    amzn.to/3AYGdbz
    Donate with PayPal (Thank you so much!)
    www.paypal.com/donate/?hosted...
    ☕Complete Java course:
    codingwithjohn.thinkific.com/...
    codingwithjohn.com

Komentáře • 232

  • @JoonPark1
    @JoonPark1 Před 3 lety +379

    I'm not kidding when I say you're the best Java teacher in CZcams

    • @neerajmadad1150
      @neerajmadad1150 Před 2 lety +2

      +1

    • @socaljusticewarrior558
      @socaljusticewarrior558 Před 2 lety +3

      Absolutely. Caleb Curry is the worst. The difference is between an experienced engineer and a kid fresh out of college.

    • @deepsuryavanshi6256
      @deepsuryavanshi6256 Před rokem +1

      absolutely correct no doubt..👍👍

    • @Yummycinnamonroll
      @Yummycinnamonroll Před 8 měsíci

      He makes learning java more fun 😢💖

    • @JohnX-tf7yf
      @JohnX-tf7yf Před 7 měsíci +1

      This guy is only the best for amateurs like you 😂. He barely touches on a topic.
      If you are learning Java with this guy's tutorials, you'll end up knowing nothing about actually writing java code.
      He is an elementary teacher!

  • @19891214ful
    @19891214ful Před 2 lety +76

    I’ve been in the industry for 8+ years and sometimes I forget the basics. Thank you very much for the effort. You are a brilliant teacher. Respect ✊ ❤️

  • @lost_mallu
    @lost_mallu Před 2 lety +15

    That last "Grawlneenlnenleng" though😂

  • @jvsnyc
    @jvsnyc Před 3 lety +31

    Excellent. I can hardly think of anything to add that wouldn't make it too long. Some people might think "Who needs this crap anymore, we have lambdas now and they are even neater!"
    That is more than a little true, but here's a couple of restrictions on lambdas that don't apply to anonymous inner classes:
    Lambdas can only be used with Single Abstract Method interfaces, and can only override that single abstract method itself.
    An anonymous inner class, on the other hand can merrily override more than one method, or can do even more, tho it is a good idea not to get carried away. If there's too much in it, give that sucker a name.
    An anonymous inner class can implement any interface, not just Single Abstract Method ones, again, best not to get too carried away with this but the language won't stop you, and can also subclass any abstract or concrete class if there's a good reason to.
    So lambdas are great, but it would be premature to throw Anonymous Inner Classes out of your Java toolbox.

    • @CodingWithJohn
      @CodingWithJohn  Před 3 lety +20

      Sounds like you know more than enough to be doing your own videos!

  • @a2406
    @a2406 Před 2 lety +30

    Your lessons are prompt, easy to understand, and generally fun to watch. A perfect way for me to brush up my rusty Java skills. Keep up the good word!

  • @cmasenv3818
    @cmasenv3818 Před 2 lety +10

    How does this guy not have more subscribers? Straightforward, to the point explanations that are well presented, and importantly no needless filler. Just awesome, you've earned my like, sub and comment!

  • @gregtomkins5938
    @gregtomkins5938 Před 2 lety +1

    Great channel, super clear explanations, always clearly explaining something I didn’t quite understand before. Cheers

  • @user-lf3em7zg3w
    @user-lf3em7zg3w Před 2 lety +1

    can't thank you enough for your videos
    i am starting a new job as a junior java programmer in May. I had used lots of your videos to prepare for the inverview and am using them now to prepare for the job itself. thanks :)

  • @hyrumtanner5584
    @hyrumtanner5584 Před rokem

    It's amazing how I can see and even use something fairly often and still gain insight here about what I'm really doing. Thanks.

  • @corygallego8148
    @corygallego8148 Před 4 měsíci

    You are really the best!!! Every single time I need help I come to see your videos and even if I m not 100% good with english you make it so easy to understand!! THANK YOU!

  • @KingSardius
    @KingSardius Před 8 měsíci

    You are one of the best teachers I have ever seen, you and another that I won't mention here out of respect. But I think that you videos are the clearest of any teacher that I have seen online, period. I love your videos.

  • @SiirCartierr
    @SiirCartierr Před rokem +6

    Ur carrying my uni courses so hard, thanks a lot man!

  • @akashsonar6332
    @akashsonar6332 Před 4 měsíci

    These concepts are deep and no one teaches this indepth. Glad that I found this channel.

  • @Carlos-kv6hx
    @Carlos-kv6hx Před rokem

    Thanks John for this video. You explained it very clearly. Please continue with these.

  • @ahmedbishree9429
    @ahmedbishree9429 Před 2 lety

    LoL really appreciate the creative tutorials that you made, every time that I see your smile can't hold myself smiling too, I wish that I had a tutor like you in every subject in my learning journey big thanks and hugs to you

  • @spiritualquest6092
    @spiritualquest6092 Před 10 měsíci

    Best explanation ever, after going through many tutorials of Innerclass concept. You are one of the Best Teachers.

  • @JonasKeil
    @JonasKeil Před 2 lety +1

    Another great tutorial, thank you very much John!

  • @tharinduwijetunge
    @tharinduwijetunge Před 2 lety +1

    This is exactly what I was looking for. Thank you very much for your explanation, and nice Bigfoot btw

  • @arshitrastogi2036
    @arshitrastogi2036 Před 2 lety

    Thanks for explaining it in a clear and concise manner. I am definitely subscribing your channel 👍

  • @nielltalwar1574
    @nielltalwar1574 Před 2 lety

    you are helping the java learner community a lot john. keep up the good work

  • @mustapharaimilawal8053
    @mustapharaimilawal8053 Před 6 měsíci

    Thanks a lot for making this video, your explanation is super easy to follow, you are a very good..... great teacher. I was trying to use an anonymous class for multi-threading with the run method and boom!!!, it was your second example. Thanks a lot.

  • @anlerylmaz8415
    @anlerylmaz8415 Před 2 lety

    Best Java teacher I've ever seen. And most sympatic one aswell

  • @milton_tom
    @milton_tom Před rokem

    Everything you teach is clear and understandable.

  • @felixro1006
    @felixro1006 Před 4 měsíci

    I'm going to write an exam about Java tomorow. John, you are saving me from letting it be a total desaster. Your explanation style is wonderful and you have exactly the right amount of humor in your videos. Your explanations and your English is very good understandable, even for a non-native English speaker on level B2. I honestly watch your videos as they are the best to understand, motivating, not too long but have everything important in it. You are doing a great job! Thank you and please continue like that!

  • @sebastiancarvajal3855
    @sebastiancarvajal3855 Před 7 měsíci

    Hey man, I just found your videos, I just want to say that I love you 🤣. You're a genius, I get to understand these complex topics easily in quick, short videos.

  • @user-ns7zo7gq7b
    @user-ns7zo7gq7b Před 7 měsíci

    The clearest way of providing information!
    Really a cool guy

  • @nkfasil752
    @nkfasil752 Před 2 lety

    Wow this video was so easy and fun! Loved the big foot noise, hehe!! Keep up the good work!!

  • @Valer0n07
    @Valer0n07 Před 2 lety

    Thanks for a great job. Your tutorials and explanations are the best in the whole universe:)))

  • @LTZMSYAL
    @LTZMSYAL Před rokem

    John you are a great teacher! merci pour tes videos. We watch you from France

  • @burgerbob7324
    @burgerbob7324 Před rokem

    Awesome video as always. Thanks John!

  • @user-en3bi1kf5w
    @user-en3bi1kf5w Před 2 lety

    You're the best teacher on CZcams! Thank you!!

  • @kostiantynkarzhanov9216
    @kostiantynkarzhanov9216 Před 4 měsíci

    Very good explanation! Thank you! 💛

  • @dominikbuzov5094
    @dominikbuzov5094 Před 2 lety

    Great explanation, you really helped me!

  • @Tuxon24rus
    @Tuxon24rus Před 2 lety

    It's always worth to watch your videos till the very end! xD

  • @cearobinson
    @cearobinson Před 2 lety +6

    Seriously cannot be stated enough: you produce the most easily understood, time considerate, and useful programming tutorials, period.
    From a 35 year old junior engineer: thank you ❤️.

  • @achyuthraosathvick45
    @achyuthraosathvick45 Před 4 měsíci +3

    Interviewer: So what is an anonymous class in java?
    My brain: 2:21

  • @naturalrunning
    @naturalrunning Před rokem

    Thank you very much for your work! It's both - learning and having fun at the same time :-)

  • @filiprank9870
    @filiprank9870 Před rokem +1

    Thank you for your tutorials.

  • @aidoka2000
    @aidoka2000 Před rokem

    Learned something new form another awesome tutorial by John :)

  • @CinziaBocchi
    @CinziaBocchi Před 2 lety

    Your tutorials are great. Thank you very much.

  • @fcoGaz
    @fcoGaz Před rokem +1

    The best vides of Java...Thanks a lot

  • @fernandamaurer9461
    @fernandamaurer9461 Před 3 měsíci

    really clear, you are an excellent teacher

  • @AbdelhameedGamal-ki7th
    @AbdelhameedGamal-ki7th Před 4 měsíci

    thanks a punch for your simple, direct and nice explanations

  • @rajattiwari8852
    @rajattiwari8852 Před 2 lety

    Came across your youtube channel. I'm sorted for brushing up. Great videos

  • @liliabekuzinaensosense8987

    John, you are such a talented teacher! 💫

  • @hihiirokane_gbf
    @hihiirokane_gbf Před 2 lety

    thank you so much for this video^ ^
    it helped me a lot

  • @emersontavera9362
    @emersontavera9362 Před rokem

    I love java, I'm reading The Java complete reference 11-edition and doing some online course, I think I just found the java grial in your channel, good content, thanks man

  • @favorohanwe9575
    @favorohanwe9575 Před rokem

    this was so good, thank you!

  • @amreleraky-wq9wb
    @amreleraky-wq9wb Před rokem

    Thanks a lot, great explanation

  • @andresencolombia
    @andresencolombia Před 2 lety

    You are simply awesome. Thank you so much. You demystify Java programming.

  • @aquarius7600
    @aquarius7600 Před 2 lety +3

    Amazing work! You explained incredibly this topic that was bugging me

  • @kushantsingh1563
    @kushantsingh1563 Před 7 měsíci

    Hey John ,
    Whoever you are ,wherever you are from trust me you are a genius. To possess a knowledge is great and most of the humans can inherit it but the toughest part is to share and make other people learn in the most simplest way and thats what you actually do.
    I myself have been into coding for past 10 years but when it comes to explaining things to someone I always find it difficult to look for examples and to do it in the most efficient and effective manner.
    Anyways ,was here to brush up on few interview basics and subscribing your channel to keep myself updated and come back again.
    Thanks again . Cheers!

  • @starilin8445
    @starilin8445 Před 2 lety

    I wish you were teaching at my school, your tutorials are the best

  • @phoebe3518
    @phoebe3518 Před rokem

    Thank you so much I actually understand it know

  • @robertovillanueva7077

    Your videos are great! Thank you 😀

  • @kuntaldutta2558
    @kuntaldutta2558 Před rokem

    really really very very good work sir. The way you are teaching is very good.

  • @siegfried5360
    @siegfried5360 Před 2 lety

    Perfect articulation. I like it!

  • @codewizard131
    @codewizard131 Před 2 lety

    You are the best teacher I've ever seen

  • @adamlasry5225
    @adamlasry5225 Před 2 lety

    Great teacher! Yes, one of the best!

  • @hb3643
    @hb3643 Před 2 lety

    Great explanation thx!

  • @ralfiasz
    @ralfiasz Před 2 lety

    Brilliant tutoring.

  • @nttn3666
    @nttn3666 Před 2 lety

    Fantastic video, thanks a lot

  • @semilife
    @semilife Před 2 lety

    Very clear and simple explanation.

  • @ShermukhammadKarimov
    @ShermukhammadKarimov Před měsícem

    thanks for the great explanation

  • @suryateja1996
    @suryateja1996 Před rokem

    Thanks John. This is really useful. I loved that bigfoot sound lol,. It's so accurate

  • @anjan5545
    @anjan5545 Před 2 lety

    Awesome..Please explain Supplier,Consumer,Predicate,Function etc..Many thanks for making things easy to learn.

  • @nafishy
    @nafishy Před 2 lety

    You're a blessing! 😭❤️

  • @igor9919
    @igor9919 Před 4 měsíci

    hi John, I've been loving your content so far, I wanted to give a suggestion if you don't mind! One of the things we wonder as we learn new concepts, which you make it very easy to understand is how we could/would use this in a real world situation, because obviously the examples used are simple (so we can understand), so perhaps it would be nice to add some "real world scenario" use case, just so we can have that extra "ahhh that makes sense" :D

  • @dlvinhafeez9966
    @dlvinhafeez9966 Před rokem

    you are the best java instructor

  • @martincaceres6209
    @martincaceres6209 Před 7 měsíci

    Really usefull, thanks! 😃

  • @yonatanshkolsky4396
    @yonatanshkolsky4396 Před 2 lety

    Amazing! Thank you!

  • @louman4322
    @louman4322 Před rokem

    You're awesome man. Thank you.

  • @abdulraqebal-sarori6390

    Your videos are amazing and the best thing that you explain very important things in the easiest and shortest ways. Would you please make some videos a bout Spring framework (web) thank you 😊

  • @Skilur1983
    @Skilur1983 Před 5 měsíci

    Great explanation. Loved bigfoot noise

  • @liliannakiss290
    @liliannakiss290 Před 2 lety

    Wow, I love those tutorials!

  • @iIO_OIi
    @iIO_OIi Před rokem

    OHhh, so those are classes, good to know.
    It's also nice to know there's a way to make a class that can only ever have one instance of itself, because I wanted that for something I want to do in the future, and will probably use it for many other things.

  • @ajitckattukkaran9404
    @ajitckattukkaran9404 Před 2 lety

    Nice presentation and explanation 👏👏

  • @mauiuwelcome6847
    @mauiuwelcome6847 Před 2 lety

    😅😅😅 Your bigfoot noising stuff was exhilarating. Love this kind of funny teaching method as it has proven to be very efficient. Thanx a lot!

  • @arsollo9972
    @arsollo9972 Před 2 lety

    I love this channel !

  • @banujan.b2479
    @banujan.b2479 Před rokem +1

    Sometime I confuse you with "programming with mosh". Big fan of both of you!

    • @CodingWithJohn
      @CodingWithJohn  Před rokem +1

      Mosh is awesome! Another bald programmer with glasses.

  • @jaydeepmalviay2582
    @jaydeepmalviay2582 Před rokem

    Simply to the point...

  • @TaniaBenitezR
    @TaniaBenitezR Před 2 lety

    I like your videos and how you explain everything. 😁

  • @johntravolta2655
    @johntravolta2655 Před 2 lety

    Yep, still the best explanation I could have came across

  • @tresaidh3y90
    @tresaidh3y90 Před 2 lety +4

    I spend about two hours every day with you John. We will land a developer job in 2022!

    • @dataslid
      @dataslid Před rokem

      Have u landed a job

    • @tresaidh3y90
      @tresaidh3y90 Před rokem

      @@dataslid I have my first interview today!!!

    • @dataslid
      @dataslid Před rokem

      @@tresaidh3y90 I wish u luck🤞

    • @CodingWithJohn
      @CodingWithJohn  Před rokem +1

      Good luck, let us know how it goes!

  • @Nathan00at78Uuiu
    @Nathan00at78Uuiu Před 6 měsíci

    This helped me understand some code at work. There is an anonymous class that is implementing an abstract class that takes in a Generic Type which implements an Interface with a Generic Type. So public abstract class PortalAsyncCallback implements AsyncCallback and the anonymous class is actually only overriding the methods from the AsyncCallback Interface.

  • @juliaineslopez4856
    @juliaineslopez4856 Před 2 lety

    You are THE BEST. Never stop making videos!! I have a question. Can we include fields in an anonymous class? I read we cant because we can't include a statement in a statement but i'm not conviced!

  • @tahiriqbal8543
    @tahiriqbal8543 Před 2 lety

    woo explaination is exquisite

  • @dinaadel1672
    @dinaadel1672 Před rokem

    Thank you very much

  • @king94596511
    @king94596511 Před 2 lety

    you are the best for learning JAVA. I am sure about it.

  • @simbarashemuzika2157
    @simbarashemuzika2157 Před 2 lety

    John you are simply the best . Do you have any Springboot tutorials

  • @ShubhamChakrabortyBA--
    @ShubhamChakrabortyBA-- Před 2 lety +2

    Sir, please make a video on Singleton classes.

  • @yassirnasri4900
    @yassirnasri4900 Před rokem

    Keep Up the good work

  • @andreajeanbatchelor5142

    Amazing!

  • @rivaru1703
    @rivaru1703 Před 11 měsíci

    great vid thanks

  • @globalshooky5030
    @globalshooky5030 Před 7 měsíci

    thank you so much

  • @jeffreyzeiberg4033
    @jeffreyzeiberg4033 Před rokem

    Thanks!

  • @pedroaboffa
    @pedroaboffa Před 2 lety

    Thank you !!!!

  • @jellyjollyjelly9513
    @jellyjollyjelly9513 Před 7 měsíci

    best java teacher

  • @MTB_Bay_Area
    @MTB_Bay_Area Před rokem

    Thank you

  • @bwprogrammers874
    @bwprogrammers874 Před 3 lety +1

    My java instructor... i hope you will do video on generics someday anyway ,best content as always...