Java Anonymous Inner Classes Explained in 6 Minutes

  Рет қаралды 97,739

Coding with John

Coding with John

Күн бұрын

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.audibletria...
🖥️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...
☕Complete Java course:
codingwithjohn...
codingwithjohn...

Пікірлер: 226
@19891214ful
@19891214ful 2 жыл бұрын
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 ✊ ❤️
@jvsnyc
@jvsnyc 3 жыл бұрын
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 3 жыл бұрын
Sounds like you know more than enough to be doing your own videos!
@lost_mallu
@lost_mallu 2 жыл бұрын
That last "Grawlneenlnenleng" though😂
@a2406
@a2406 2 жыл бұрын
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!
@achyuthraosathvick45
@achyuthraosathvick45 5 ай бұрын
Interviewer: So what is an anonymous class in java? My brain: 2:21
@unaigonzalezsanchez5945
@unaigonzalezsanchez5945 5 ай бұрын
hahahahahha good one
@cmasenv3818
@cmasenv3818 2 жыл бұрын
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!
@SiirCartierr
@SiirCartierr Жыл бұрын
Ur carrying my uni courses so hard, thanks a lot man!
@CodingWithJohn
@CodingWithJohn Жыл бұрын
Happy to help!
@akashsonar6332
@akashsonar6332 5 ай бұрын
These concepts are deep and no one teaches this indepth. Glad that I found this channel.
@tresaidh3y90
@tresaidh3y90 2 жыл бұрын
I spend about two hours every day with you John. We will land a developer job in 2022!
@dataslid
@dataslid Жыл бұрын
Have u landed a job
@tresaidh3y90
@tresaidh3y90 Жыл бұрын
@@dataslid I have my first interview today!!!
@dataslid
@dataslid Жыл бұрын
@@tresaidh3y90 I wish u luck🤞
@CodingWithJohn
@CodingWithJohn Жыл бұрын
Good luck, let us know how it goes!
@felixro1006
@felixro1006 6 ай бұрын
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!
@cearobinson
@cearobinson 2 жыл бұрын
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 ❤️.
@KingSardius
@KingSardius 10 ай бұрын
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.
@Nathan00at78Uuiu
@Nathan00at78Uuiu 8 ай бұрын
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.
@fcoGaz
@fcoGaz Жыл бұрын
The best vides of Java...Thanks a lot
@filiprank9870
@filiprank9870 Жыл бұрын
Thank you for your tutorials.
@corygallego8148
@corygallego8148 6 ай бұрын
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!
@cavendar24
@cavendar24 Жыл бұрын
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.
@johncusack4730
@johncusack4730 14 күн бұрын
Fantastic, you're the best !
@AbdelhameedGamal-ki7th
@AbdelhameedGamal-ki7th 6 ай бұрын
thanks a punch for your simple, direct and nice explanations
@dlvinhafeez9966
@dlvinhafeez9966 Жыл бұрын
you are the best java instructor
@Юлия-т7ц7и
@Юлия-т7ц7и 2 жыл бұрын
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 :)
@emersontavera9362
@emersontavera9362 Жыл бұрын
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
@kostiantynkarzhanov9216
@kostiantynkarzhanov9216 6 ай бұрын
Very good explanation! Thank you! 💛
@spiritualquest6092
@spiritualquest6092 Жыл бұрын
Best explanation ever, after going through many tutorials of Innerclass concept. You are one of the Best Teachers.
@fernandamaurer9461
@fernandamaurer9461 5 ай бұрын
really clear, you are an excellent teacher
@igor9919
@igor9919 6 ай бұрын
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
@ЕвгенийСкорик-ь5ю
@ЕвгенийСкорик-ь5ю 9 ай бұрын
The clearest way of providing information! Really a cool guy
@JonasKeil
@JonasKeil 2 жыл бұрын
Another great tutorial, thank you very much John!
@anlerylmaz8415
@anlerylmaz8415 2 жыл бұрын
Best Java teacher I've ever seen. And most sympatic one aswell
@sebastiancarvajal3855
@sebastiancarvajal3855 9 ай бұрын
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.
@milton_tom
@milton_tom Жыл бұрын
Everything you teach is clear and understandable.
@aquarius7600
@aquarius7600 2 жыл бұрын
Amazing work! You explained incredibly this topic that was bugging me
@CodingWithJohn
@CodingWithJohn 2 жыл бұрын
Glad it was helpful!
@הדרפדה-אל
@הדרפדה-אל 2 жыл бұрын
You're the best teacher on KZbin! Thank you!!
@Skilur1983
@Skilur1983 7 ай бұрын
Great explanation. Loved bigfoot noise
@starilin8445
@starilin8445 2 жыл бұрын
I wish you were teaching at my school, your tutorials are the best
@gregtomkins5938
@gregtomkins5938 2 жыл бұрын
Great channel, super clear explanations, always clearly explaining something I didn’t quite understand before. Cheers
@ShubhamChakrabortyBA--
@ShubhamChakrabortyBA-- 2 жыл бұрын
Sir, please make a video on Singleton classes.
@iIO_OIi
@iIO_OIi Жыл бұрын
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.
@kuntaldutta2558
@kuntaldutta2558 2 жыл бұрын
really really very very good work sir. The way you are teaching is very good.
@manojr5257
@manojr5257 2 жыл бұрын
Confiremed! John is a friend of Big Foot!
@kushantsingh1563
@kushantsingh1563 9 ай бұрын
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!
@codewizard131
@codewizard131 2 жыл бұрын
You are the best teacher I've ever seen
@jaydeepmalviay2582
@jaydeepmalviay2582 Жыл бұрын
Simply to the point...
@ralfiasz
@ralfiasz 2 жыл бұрын
Brilliant tutoring.
@tharinduwijetunge
@tharinduwijetunge 2 жыл бұрын
This is exactly what I was looking for. Thank you very much for your explanation, and nice Bigfoot btw
@LTZMSYAL
@LTZMSYAL 2 жыл бұрын
John you are a great teacher! merci pour tes videos. We watch you from France
@johndrowned7170
@johndrowned7170 Жыл бұрын
I Totally agree with the guy that wrote Im not kidding whe I say you´re the best Java Teacher but to help the purpose of the channel im creating another comment
@mustapharaimilawal8053
@mustapharaimilawal8053 8 ай бұрын
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.
@nkfasil752
@nkfasil752 2 жыл бұрын
Wow this video was so easy and fun! Loved the big foot noise, hehe!! Keep up the good work!!
@ShermukhammadKarimov
@ShermukhammadKarimov 3 ай бұрын
thanks for the great explanation
@Ozla102
@Ozla102 2 жыл бұрын
you are the best for learning JAVA. I am sure about it.
@banujan.b2479
@banujan.b2479 2 жыл бұрын
Sometime I confuse you with "programming with mosh". Big fan of both of you!
@CodingWithJohn
@CodingWithJohn 2 жыл бұрын
Mosh is awesome! Another bald programmer with glasses.
@favorohanwe9575
@favorohanwe9575 Жыл бұрын
this was so good, thank you!
@alvinchipmunk7279
@alvinchipmunk7279 2 жыл бұрын
John, please make a video with lambda explaining
@aidoka2000
@aidoka2000 Жыл бұрын
Learned something new form another awesome tutorial by John :)
@amreleraky-wq9wb
@amreleraky-wq9wb Жыл бұрын
Thanks a lot, great explanation
@Tuxon24rus
@Tuxon24rus 2 жыл бұрын
It's always worth to watch your videos till the very end! xD
@louman4322
@louman4322 2 жыл бұрын
You're awesome man. Thank you.
@simbarashemuzika2157
@simbarashemuzika2157 2 жыл бұрын
John you are simply the best . Do you have any Springboot tutorials
@2k7Bertram
@2k7Bertram 2 жыл бұрын
That bigfoot statement had me like "Wait...what??"
@Carlos-kv6hx
@Carlos-kv6hx Жыл бұрын
Thanks John for this video. You explained it very clearly. Please continue with these.
@phoebe3518
@phoebe3518 2 жыл бұрын
Thank you so much I actually understand it know
@hihiirokane_gbf
@hihiirokane_gbf 2 жыл бұрын
thank you so much for this video^ ^ it helped me a lot
@nielltalwar1574
@nielltalwar1574 2 жыл бұрын
you are helping the java learner community a lot john. keep up the good work
@Agammoravia
@Agammoravia Жыл бұрын
You're my Java only teacher!! =)
@jellyjollyjelly9513
@jellyjollyjelly9513 9 ай бұрын
best java teacher
@johntravolta2655
@johntravolta2655 2 жыл бұрын
Yep, still the best explanation I could have came across
@anjan5545
@anjan5545 2 жыл бұрын
Awesome..Please explain Supplier,Consumer,Predicate,Function etc..Many thanks for making things easy to learn.
@burgerbob7324
@burgerbob7324 Жыл бұрын
Awesome video as always. Thanks John!
@ahmedbishree9429
@ahmedbishree9429 2 жыл бұрын
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
@xetbytetechnology1445
@xetbytetechnology1445 2 жыл бұрын
I have been traveling on 🌍 Earth with Java for 10 years just 5 miles, but after watching your video tutorial approx 6:26 minutes I have traveled with Java 24,887.64 miles which is exactly the circumference of the Earth. Now I am 🦋🦋🦋 flying with Java in ✈🛩🪐. A lot of thanks. I really appreciate.
@rajattiwari8852
@rajattiwari8852 2 жыл бұрын
Came across your youtube channel. I'm sorted for brushing up. Great videos
@Roman-qq9gx
@Roman-qq9gx 11 ай бұрын
well made vid, thanks. “one-time-use class with an interface”. jesus, I love how much easier this is in JS. that is just a simple variable. strong OOP is jaded 😂
@suryateja1996
@suryateja1996 Жыл бұрын
Thanks John. This is really useful. I loved that bigfoot sound lol,. It's so accurate
@andresencolombia
@andresencolombia 2 жыл бұрын
You are simply awesome. Thank you so much. You demystify Java programming.
@liliabekuzinaensosense8987
@liliabekuzinaensosense8987 Жыл бұрын
John, you are such a talented teacher! 💫
@arshitrastogi2036
@arshitrastogi2036 2 жыл бұрын
Thanks for explaining it in a clear and concise manner. I am definitely subscribing your channel 👍
@tomgu9430
@tomgu9430 Жыл бұрын
voice of big foot lol, best teacher ever!
@martincaceres6209
@martincaceres6209 9 ай бұрын
Really usefull, thanks! 😃
@mauiuwelcome6847
@mauiuwelcome6847 2 жыл бұрын
😅😅😅 Your bigfoot noising stuff was exhilarating. Love this kind of funny teaching method as it has proven to be very efficient. Thanx a lot!
@semilife
@semilife 2 жыл бұрын
Very clear and simple explanation.
@siegfried5360
@siegfried5360 2 жыл бұрын
Perfect articulation. I like it!
@juliaineslopez4856
@juliaineslopez4856 2 жыл бұрын
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!
@Valer0n07
@Valer0n07 2 жыл бұрын
Thanks for a great job. Your tutorials and explanations are the best in the whole universe:)))
@CinziaBocchi
@CinziaBocchi 2 жыл бұрын
Your tutorials are great. Thank you very much.
@nafishy
@nafishy 2 жыл бұрын
You're a blessing! 😭❤️
@tahiriqbal8543
@tahiriqbal8543 2 жыл бұрын
woo explaination is exquisite
@bendustin7609
@bendustin7609 Жыл бұрын
I wish you taught my CPSC class!
@yass_h_z
@yass_h_z Жыл бұрын
YOU ARE THE BEST U HAVE BEEN SAVING LIVES FOREVER
@CodingWithJohn
@CodingWithJohn Жыл бұрын
I had no idea anonymous inner classes could save lives!
@yass_h_z
@yass_h_z Жыл бұрын
Hahahahaha i cannot believe that you replied to me thanks man i really appreciate the efforts you're making and the awesome explanations (Btw my exam is tomorrow hahaha)
@CodingWithJohn
@CodingWithJohn Жыл бұрын
Good luck, let us all know how it goes!
@yass_h_z
@yass_h_z Жыл бұрын
@@CodingWithJohn yess for sureee
@yass_h_z
@yass_h_z Жыл бұрын
@@CodingWithJohn it was really difficult , mostly about stream but i did what i could
@xhappybunnyx
@xhappybunnyx 2 жыл бұрын
Legit just clicked on the vid and need to bet that the thumbnail's a suburban sasquatch reference edit: damn (also real talk I love these videos, they're a wonderful supplement to a free online course I'm doing. might check yours out later!)
@dinaadel1672
@dinaadel1672 Жыл бұрын
Thank you very much
@yassirnasri4900
@yassirnasri4900 2 жыл бұрын
Keep Up the good work
@adamlasry5225
@adamlasry5225 2 жыл бұрын
Great teacher! Yes, one of the best!
@robertovillanueva7077
@robertovillanueva7077 2 жыл бұрын
Your videos are great! Thank you 😀
@dominikbuzov5094
@dominikbuzov5094 2 жыл бұрын
Great explanation, you really helped me!
@naturalrunning
@naturalrunning Жыл бұрын
Thank you very much for your work! It's both - learning and having fun at the same time :-)
@bwprogrammers874
@bwprogrammers874 3 жыл бұрын
My java instructor... i hope you will do video on generics someday anyway ,best content as always...
@OgedeiKhanOKOK
@OgedeiKhanOKOK 2 жыл бұрын
How to decide when to use Anonymous Inner Class vs Singleton Design Pattern ? Is size of the class the only factor or something else too.
@liliannakiss290
@liliannakiss290 2 жыл бұрын
Wow, I love those tutorials!
@LukasJozefaciuk
@LukasJozefaciuk 11 ай бұрын
can you also explain the diffrence between Anonymous Inner Class and Singleton? Thanks in advance. I can only confirm a perfect teacher so i am enjoyful enjoy each session. Thanks
Multithreading in Java Explained in 10 Minutes
10:01
Coding with John
Рет қаралды 923 М.
Java Reflection Explained - bɘniɒlqxƎ noiɟɔɘlʇɘЯ ɒvɒᒐ
20:07
Coding with John
Рет қаралды 182 М.
Секрет фокусника! #shorts
00:15
Роман Magic
Рет қаралды 120 МЛН
HAH Chaos in the Bathroom 🚽✨ Smart Tools for the Throne 😜
00:49
123 GO! Kevin
Рет қаралды 13 МЛН
Новый уровень твоей сосиски
00:33
Кушать Хочу
Рет қаралды 4,4 МЛН
The Flaws of Inheritance
10:01
CodeAesthetic
Рет қаралды 942 М.
Generics In Java - Full Simple Tutorial
17:34
Coding with John
Рет қаралды 1 МЛН
Java's Creators Rejected Multiple Inheritance - Here's Why
13:14
Coding with John
Рет қаралды 69 М.
Making an Algorithm Faster
30:08
NeetCodeIO
Рет қаралды 49 М.
Optionals In Java - Simple Tutorial
15:53
Coding with John
Рет қаралды 211 М.
Dependency Injection, The Best Pattern
13:16
CodeAesthetic
Рет қаралды 819 М.
Upcasting and Downcasting in Java - Full Tutorial
10:22
Coding with John
Рет қаралды 174 М.
Java lambda λ
18:00
Bro Code
Рет қаралды 94 М.
Java Constructors - Full Tutorial
7:38
Coding with John
Рет қаралды 365 М.
Секрет фокусника! #shorts
00:15
Роман Magic
Рет қаралды 120 МЛН