Learn Java Tutorial for Beginners, Part 32: Anonymous Classes

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

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

  • @ayytygv
    @ayytygv 8 лет назад +21

    dude you explained this more clearly than anyone else I've seen. great video thanks

  • @pcpelizzaro
    @pcpelizzaro 9 лет назад +7

    I was trying to learn Java through the Oracle tutorials, and was stuck on this subject for over a week. In fact I stopped for a while, and am going back to it now. You made it all very clear to me. Thanks a lot.

  • @caveofprogramming
    @caveofprogramming  11 лет назад +3

    Cheers! I don't rehearse but I do often record a video multiple times till it's right.

  • @BryceRogers
    @BryceRogers 10 лет назад +8

    this tutorial was soooooo clear and well explained compared to every other source I tried learning about anonymous classes from. love your work!

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

    Been working on event listeners/handlers in Android and all the stuff about working with anonymous classes confused me until I watched this. Thanks!

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

    Im a software engineer and to be honest, have dealt with an onslaught of having to learn more than a few languages. Sometimes I get rusty and I love going back to your videos to get a great refresher on things that are clear but need to be crystal. Great explainations!

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

      There are so many things that are almost (but not quite) the same in Java and C# in particular that jumping back and forth is rather disorienting. At least I'm not dropping ;'s and { } 's like when I go into Python mode for a few days and come back....

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

    Thank you sir.
    Usually, I don't leave comments. But this great tutorial made me do it.

  • @OhadS
    @OhadS 11 лет назад +1

    I study computer science and your videos are very helpful and very clear to understand , thank you very much !

  • @PsychoactiveMauling
    @PsychoactiveMauling 11 лет назад +1

    I really appreciate you taking the time to make these excellent tutorials, in my opinion they are the best tutorials on RUclips and deserve many more views than the thenewboston.
    Keep up the goodwork!

  • @richardhesse6341
    @richardhesse6341 11 лет назад +1

    Clear voice, good quality, logically explanations !! Thank you !!! You really helped me to understand the consept of anonymous classes !!

  • @akshathm.s4506
    @akshathm.s4506 9 лет назад +3

    Hi John thanks a lot for wonderful lessons , I haven't done programming before,Java is my first programming I can understand each and every video lesson.Your are my tutor, everyday I am learning from your cave of programming ...The way explain awesome.I have become your fan :) ...

  • @ryananthony6478
    @ryananthony6478 9 лет назад +6

    I have watched all of your previous tutorials. You are amazing dude!

  • @heat4life869
    @heat4life869 8 лет назад +9

    package main;
    public class John {
    public static void main(String[] args) {
    System.out.println("Thanks! This Tutorials are epic!");
    }
    }

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

      Lol
      for (int i = 0; i < 100; i++){
      System.out.println("Thanks! This Tutorials are epic!");
      }

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

      Let's take it one step further:
      while(true)
      System.out.println("Great videos! Best tutorials on teh Interwebz!");

  • @dmonflipd
    @dmonflipd 11 лет назад +3

    - Found Your Swing (GUI) Course on Udemy... - just signed up for it - !
    - Thanks again for the resource - !
    - I'd encourage You to make a C++ Course(s)... - as I read on Cave Of Programming that You are experienced in that language also - & I'm certain that it would help me as I begin to learn C++ (& C) throughout University -
    D.

    • @Claymore2408
      @Claymore2408 11 лет назад +2

      I second this, I think we all should encourage John to create c++ tutorials, well that is if he has the time for it :) C++ can be used for many things in which Java cannot do such as creating game/rendering engines, real time embedded systems etc. Thanks for the tutorials though, makes programming more enjoyable.

  • @ExamineTheTruth
    @ExamineTheTruth 11 лет назад +1

    omg.. you totally explained that for me... i was going through some oracle java docs, and it was confusing... that is when i found this tutorial with a "master piece theater" opening... :)

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

    I forgot I'd watched this one video, it must have been where I saved this playlist, expecting to come back to it if I actually started using Java as my main language at some point. Very cool. Most of the first 31 were review for me, altho I'd been writing so much C# that C# was coming out of my fingertips when I meant to write Java lately. This one is cool and something that casual Java users could easily forget/get confused when they see or need to use. Great video.

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

    you just showed how to explain a theme without making it more confusing as others do in their videos. great explaination

  • @caveofprogramming
    @caveofprogramming  11 лет назад +1

    Thanks! I have a whole massive tutorial on GUI programming in Java, but only the first few videos are free. You can find all my stuff on my website (which I revamped recently so it's no longer an eyesore) ... search for Cave of Programming.

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

    Very cool! Great for quickly writing something up to test an idea.
    Love how clear and concise your explanation is.

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

    U ve taught it so well, way better than any other java tutorial I saw in google

  • @MorganHowell1995
    @MorganHowell1995 10 лет назад +1

    I commend you on your engaging lectures. Thank you so very much for your service in helping others understand these concepts!

  • @jonhipkins18
    @jonhipkins18 10 лет назад +1

    Very powerful concepts. Thank you for the tutorial.

  • @_TheDudeAbides_
    @_TheDudeAbides_ 9 лет назад +1

    Interesting topic, I had never heard of this before. It feels a little bit like the readability gets a bit worse when using anonymous classes...

  • @subramaniannk3364
    @subramaniannk3364 9 лет назад

    Well done and thank you! I understood the concept. But, I think it would be better if you could add more methods in Machine class and show that the object machine1 could access those methods as well. Only then, you will be showing "clearly" that overriding takes place.

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

    I like the Beethoven 4th piano concerto in the background

  • @GautamKumar-rk5ff
    @GautamKumar-rk5ff 6 лет назад +1

    Many thanks for great effort, please upload successors tututorial as well. Loved it ☺️

  • @jagermeister5
    @jagermeister5 11 лет назад +1

    you made it so easy thank you very much

  • @TimpisHouse
    @TimpisHouse 9 лет назад +1

    Anonymous classes seems a bit confusing to learn, it almost feels like I'm creating a class and implementing an interface but I'm doing it backwards with the class name unknown. Do you think I can move on with the tutorials before understanding this to a fully 100% and that I eventually will get this, or should I try to search around a little on the web for further information about anonymous classes?

    • @johnpurcell827
      @johnpurcell827 9 лет назад +1

      +TimpisHouse You can move on, sure. I mainly use anonymous classes only when responding to Swing button clicks, and then you get used to just doing the procedure for creating some onclick code and not worrying about it. When you can add some code to a button, or start a thread using an anonymous class, you've basically grasped all you really need to know about it. You can even just never use them at all if you don't like them.

    • @TimpisHouse
      @TimpisHouse 9 лет назад

      +John Purcell Thanks a lot for the good and fast response. Also i notcied that you had an android icon on your desktop, do you have an android and/or a "callback/alerting" tutorial as well?

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

      +TimpisHouse Sorry I missed this. I do have an android course, it's free on my site, but a bit old (uses Eclipse instead of Android Studio). I don't think I cover callback/alerting though -- not sure what it is. I cover onclick-type stuff of course, if you mean this stuff.

  • @AmandeepSingh-hd8iq
    @AmandeepSingh-hd8iq 9 лет назад +1

    Beautifully explained. Thanks

  • @junkballdude
    @junkballdude 9 лет назад +1

    Clear and articulate! Was that you playing the Beethoven concerto?

    • @johnpurcell827
      @johnpurcell827 9 лет назад +1

      Junky Baller I wish it was, but no, it was Debbie Hu.

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

    Thanks for this John (as ever). May I make a suggestion (I've thought it for the last few videos in this course on more difficult topics, but have been prompted by your closing remark about GUI programming); I appreciate it's too late for this course. You explain things really clearly, but beginners may struggle to understand why it's necessary to have these techniques. A good example is lambda expressions (in Java 8): explaining them might make sense but the beginner may struggle with why are they necessary / where to use them / what problem they solve. It may help understanding to add some brief observations about how the technique might be deployed in the real world / why it exists. Thanks again.

    • @johnpurcell827
      @johnpurcell827 8 лет назад +4

      Thanks Alphonso, you're not the first to say it. If I remake the course one day, I'll add more exercises at least. With lambda expressions it's particularly tricky to give examples, because I can't think of many examples that would really make sense to a beginner. Perhaps I could have illustrated using the Timer class. But then there's still not much you can usefully do with a Timer unless you know some Swing or something.

  • @willmorsy
    @willmorsy 11 лет назад +1

    Great and simple

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

    Insanely well explained! Thank you so much; this has probably been the hardest concept to grasp this far

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

    So simple yet so powerful! Thank you for this beautiful tutorial❤️

  • @syednayyar
    @syednayyar 10 лет назад +4

    you exactly told what i want to hear and for which i was about to hit my head on wall . That how SetOnClickListener and ClickListener is working what the hell wrong with my udnerstanding on this code and after looking at your example i will look again the code and will surely make the sense after learning from your tutorial...thanks a bunch ....!! great tutorials i must accept...!!

  • @MrLouRolfes
    @MrLouRolfes 11 лет назад +1

    Thanks for our comments?! No...Thank YOU for these tutorials! I can't wait to complete this beginners course so I can move on to some of your other courses at caveofprogramming. You are giving hope to my dreams of making a career change. Thanks!

  • @dmonflipd
    @dmonflipd 11 лет назад

    - Great Series of Tutorials... - Thank You - !
    - Did You make the follow-up video that further demonstrates this concept / technique when used in conjunction with GUI programming - (?)
    D.

  • @Marinakulichok
    @Marinakulichok 8 лет назад +2

    I feel like I am on the symphony at 9 am)) Relaxing music)

  • @TheWildchildxx
    @TheWildchildxx 10 лет назад +1

    Hi John!!
    I just want to say thank you again for all your free videos and have a marry Christmas!!
    *** also i dont really understand the concept of the anonymus classes, for what reason we use them, and the methods declared in anonymus classes are the onese being displayed when the methods are overwritten from other classes. Why is that so?
    I am still stuck on this level even tho i started watching Swing tutorial aswell..
    I have watched these beginners tutorials two times and there are some things i still dont understand or i understand but cant really remember how to use it, is that normal?
    I have way too many questions but i know you dont have time answering them all, so once again Marry Christmas.Ah yeah and you should try duck breast and red cabbage, thats a traditional hungarian dish for Christmas!
    Cheers

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

    great video! You've explained it in the best possible way for begginers!

  • @foxybarker
    @foxybarker 10 лет назад

    John, do you have anything on type alias in Java? I think I know that Java doesn't do type alias but I want to get your thoughts.

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

    I like the music and the chill lecture tone.

  • @rkanimation7006
    @rkanimation7006 10 лет назад

    i was having so much trouble for tht curly braces understanding ... thnk u so much for simple trick ... :) :)

  • @43RP
    @43RP 11 лет назад +1

    Your tutorials are amazing.
    Thank you.

  • @TommyGTime
    @TommyGTime 9 лет назад +1

    Perfect explanation. Thanks!

  • @IAmSetas
    @IAmSetas 11 лет назад +2

    awesome, best tutorials ever, very simple and clear.

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

    perfect explanation!

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

    Love your tutorials, all the best man

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

    Perfect explanation, the best on RUclips.

  • @azharulislam4111
    @azharulislam4111 9 лет назад +1

    Excellent............!

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

    This is pretty important for Android Development where you have to make your own event listeners .

  • @80amnesia
    @80amnesia 11 лет назад +1

    thnx

  • @ROCKER8335
    @ROCKER8335 9 лет назад +1

    Thank you very much

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

    Can new methods be added to the anonymous class? Or only overridden methods from the extended class or implemented interface?

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

    Im going to listen to your soothing voice to help me fall asleep

  • @wojciechszczotka4989
    @wojciechszczotka4989 9 лет назад +1

    thanks for effort. Good job.

  • @Lodevlaeminck
    @Lodevlaeminck 12 лет назад

    500 views? I dont get it, best Tutorial vids I found on youtube so far...

  • @sankar151981
    @sankar151981 11 лет назад +1

    Super..

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

    excellent sir Thanx!!

  • @kenmtb
    @kenmtb 11 лет назад +1

    beautifully done...thanks!

  • @neeravarora530
    @neeravarora530 10 лет назад +1

    Excelllent lecture :)

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

    Perfect Tutorial!!! Great Job!!!

  • @LUX1111111111111
    @LUX1111111111111 10 лет назад +5

    love this tutorial!!!!

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

    Man you are a legend.

  • @TOHYM
    @TOHYM 11 лет назад +1

    I hope (in the near future) to financially contribute to the cave. Thank you.

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

    Very clear, great job, thank you!

  • @pedrohenriquebalaios
    @pedrohenriquebalaios 10 лет назад +1

    Thank you so much lad!

  • @jvsnyc
    @jvsnyc 9 лет назад

    This is one of those topics that separates the C/C++ programmers who know a bit of Java, or dabblers, from people who really know how to use Java. It still looks weird and tripped out to me as a mostly C/C++ programmer but I'll watch this video until it seems like the most natural thing in the world, because as you point out, you want to focus on what the programmer is trying to accomplish in places where they use anonymous classes, not put off by and looking funny at this construct.

  • @VikasPachori05
    @VikasPachori05 10 лет назад +1

    thanxx for this lesson..!!1

  • @java-aws-techie
    @java-aws-techie 11 лет назад +1

    Thx 4 posting...:)

  • @leonkig123
    @leonkig123 10 лет назад

    Please explain how you run program containing multiple classes within single *.java file.
    I understand that this is for learning purposes, but sometimes I want "to see whole picture" in one sight to elaborate something. Thanks n advance.

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

    HERO!

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

    Thank you so much. Super helpful

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

    can we use super with anonymous classes?If yes, then how?

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

    this great vidio thakyou sir, i can create anonymous class for completly my scholl job btw im from indonesian

  • @Sagittarius555555555
    @Sagittarius555555555 11 лет назад +1

    thanks !!! :)

  • @polesetti
    @polesetti 9 лет назад

    very useful, thanks

  • @123japanuser
    @123japanuser 12 лет назад

    Stay Blessed John.

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

    Very Helpful .....

  • @OPatWork
    @OPatWork 11 лет назад

    Thank you. You really helped me :)

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

    lol it's like a bastard child, it doesn't have a name. It's a jon snow class, that's how i'll think of it.

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

    please what is the reason behind the machine.start(); not displaying?

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

    lovely Tutorial. Thank you.

  • @anljdfvcwafd
    @anljdfvcwafd 10 лет назад

    WOW, that's really cool.

  • @looool9495
    @looool9495 9 лет назад

    thanks youuuuuu from Morocco

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

    Elegant

  • @xXxBladeStormxXx
    @xXxBladeStormxXx 9 лет назад

    Is this like the OOP version of Lambda's?

    • @johnpurcell827
      @johnpurcell827 9 лет назад +2

      +xXxBladeStormxXx Yes, sort of. This is the way you had to do it before lambdas came along. Now if your interface only has one method, you can use a lambda expression instead.

    • @xXxBladeStormxXx
      @xXxBladeStormxXx 9 лет назад +1

      ***** Thanks for the prompt reply.
      I also want to express my deep gratitude for these free videos. I already know other programming languages and I wanted something that taught me Java style and syntax quickly, and that is exactly what this series has done. Thank you for this.

  • @9637390050
    @9637390050 9 лет назад

    thanku v much...

  • @tyinykiller5
    @tyinykiller5 10 лет назад

    is it just me or is there no sound in these videos?

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

    thank-you

  • @KapilSharma-rp5le
    @KapilSharma-rp5le 10 лет назад

    very nice tutorilas, vice husky voice

  • @dmik1500
    @dmik1500 9 лет назад

    thank you!

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

    thanks

  • @isupposeso3516
    @isupposeso3516 10 лет назад

    OMG you sound sooo much like John Lennon mate!

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

    If I had a child, I'd give it a name "Machine". :D

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

    Thanks ;)

  • @mohamedsabribenchaabane8408
    @mohamedsabribenchaabane8408 9 лет назад

    exquisite!!

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

      +Mohamed Sabri Ben Chaabane Exquisite, also very exquisite! *Walks off a cliff after admiring a row of paintings.* Not so exquisite. Ahhhhhhhhhhhhhhhhhhh!!!!

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

    were mics this bad in 2012? Classic.

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

    In the beginning I thought lord jesus is speaking.

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

    Thank you very much.