Learn How to Use Abstract Classes

แชร์
ฝัง
  • เผยแพร่เมื่อ 27 ส.ค. 2024

ความคิดเห็น • 119

  • @andrekreou1
    @andrekreou1 2 ปีที่แล้ว +7

    I've already built the biggest part for my MSc thesis project because of you... Don't know how grateful I am for your contributions, not only for me but also to the developer community.

    • @TeslaDo
      @TeslaDo 2 ปีที่แล้ว

      You may join the courses?

  • @amigoscode
    @amigoscode  2 ปีที่แล้ว +2

    Register your interest here for Amigoscode Bootcamp: amigoscode.hopp.to/bootcamp-register-interest

  • @meanstoandend
    @meanstoandend 2 ปีที่แล้ว +23

    I very much appreciate and enjoy your content and the way you teach. I’ve been learning a lot from you and just wanted to say thanks for doing what you do 🙏

    • @moathdw910
      @moathdw910 2 ปีที่แล้ว

      It's a fine content but he still always acts religious in a very annoying way, it would be better if he keeps his beliefs to himself and keep it professional

    • @meanstoandend
      @meanstoandend 2 ปีที่แล้ว +2

      ​@@moathdw910 when you grow up you'll realize a few things. First - just because someone is religious, doesn't mean they're acting religious. You're angry at something that literally isn't referenced or talked about in any of his videos. Just because he wears traditional clothing? Man - people still have a long way to go. Second - even if he did bring his religion into this, it's a good thing to get different perspectives from different people. Don't be so afraid of things that are different from you and maybe one day you'll be able learn all the world is willing to teach you.

    • @TeslaDo
      @TeslaDo 2 ปีที่แล้ว +1

      ​@@moathdw910 It is authentic way of professionalism. Change your vision, saying hello in Arabic does not make the content religious.
      I have never heard of anything about "create" action as a religious way.
      he also says "Voila!" which does not makes him a francophone

  • @hitstick567
    @hitstick567 2 ปีที่แล้ว +22

    Could you do the same video but with interfaces? I feel like they have become more complex with each Java release. You seem to have such a great understanding of it

    • @MrBraga776
      @MrBraga776 2 ปีที่แล้ว +1

      Would be great. He already said that programing oriented to interfaces is better and is quite difficult to learn how to use it.

  • @TheSpiderWalk
    @TheSpiderWalk 2 ปีที่แล้ว +1

    Amazing, I saw that there are abstract classes but never knew what are they really for. Thank you for sharing

  • @snoopie51
    @snoopie51 ปีที่แล้ว

    Thanks for going further than the "Animal" "Shape" stuff. I never understood how to "Actually" do it with those examples.

  • @dudnik399
    @dudnik399 2 หลายเดือนก่อน

    Great example, thanks for breaking it down. Cheers.

  • @TkmMusicProduction
    @TkmMusicProduction 2 ปีที่แล้ว

    Very very clear explanation!,with real example, yes, thats true, you will never see Dogs, Cats,Squares, rectangles, foo and bar in production!, you will see business procesess like this!.. Thank you very much for your useful video! 👍👍

  • @abdedaimehicham2650
    @abdedaimehicham2650 2 ปีที่แล้ว +2

    Thank you for your explanation
    I have one remark about the method parse i think you can imporve it by avoiding boilerplate code and leagcy classes to read file and you can use Files.lines and It will return a stream and you can do filter on this stream and create another method to test the regex and apply this method on filter method .

  • @ravienu9912
    @ravienu9912 2 ปีที่แล้ว +1

    Hi @Amigoscode, I have been following your content for quite long. It's really incredible work you are doing to help all of us. Thank you very much. And I always face challenge in understanding the existing code (mostly I work on Java) when I am moving across new projects. I really appreciate if you can prepare a video on how to understand existing code base of JAVA. Thank you once again.

  • @johnronaldraviz4052
    @johnronaldraviz4052 2 ปีที่แล้ว

    I never thought of using abstract methods declared on an abstract class. Thanks a lot.

  • @wgalloPT
    @wgalloPT 2 ปีที่แล้ว

    i so thankful for everything you do over here!!! ALWAYS amazing. Thank you

  • @mandanakhashayar9678
    @mandanakhashayar9678 2 ปีที่แล้ว +1

    The very clear explanation. Thank you. Even we can have default implementation for method clear in abstract class. That can help us to modify the code much easier when the method is just needed to be implemented by some classes. Thank you so much for your useful videos.

  • @DebugWithAdam
    @DebugWithAdam 2 ปีที่แล้ว +1

    Of course it makes sense as always. Thank you so much man.

  • @patco101
    @patco101 ปีที่แล้ว

    This is a gem.

  • @dansmar_2414
    @dansmar_2414 ปีที่แล้ว

    This is a great explanation, thank you so much!

  • @CityCata
    @CityCata ปีที่แล้ว

    Im preparing for interviews in January so now Im just browsing youtube reviewing stuff 😄

  • @fipabrate
    @fipabrate 2 ปีที่แล้ว +9

    Wouldn't it be better to have default implementation of clean function (in this case only return input) in abstract class and then override it in child classes only where you want new functionality?

    • @noss403
      @noss403 2 ปีที่แล้ว +1

      It is good idea.

  • @zimmtheking
    @zimmtheking 2 ปีที่แล้ว +1

    great example and thanks for not using "cats and dogs"!!!
    please more of this pragmatic and uselful stuff.

  • @genprimabiocakti6159
    @genprimabiocakti6159 2 ปีที่แล้ว

    That non abstract method inside abstract class which call abstract method is make me understand after all. Thank you

  • @cesarhinojosa7679
    @cesarhinojosa7679 11 หลายเดือนก่อน

    I was so annoyed at being taught complex design patters and design principles with squares, circles, apples, bananas, etc. Thank you for this very helpful example!

  • @daironperezfrias7819
    @daironperezfrias7819 2 ปีที่แล้ว

    Thanks for all your content, from Cuba !!!

  • @isahbala2540
    @isahbala2540 2 ปีที่แล้ว +1

    Funny, but more interesting than Java classes in College! :)

  • @RajkumarAdhikari
    @RajkumarAdhikari 2 ปีที่แล้ว

    Watching from Nepal,🇳🇵
    lots of love😊

  • @anastasiagavrilita6567
    @anastasiagavrilita6567 2 ปีที่แล้ว

    finally: an explanation hitting its target 100% huge youtube, yet so many videos are too "abstract" :D

  • @hieubui5122
    @hieubui5122 2 ปีที่แล้ว +1

    Thanks you amigoscode

  • @carlkarama
    @carlkarama 2 ปีที่แล้ว

    Since you are producing/exporting reports, you could implement the visitor behavioural pattern on the abstract class and implement a visitor interface that accepts an export feature

  • @nedimkulovac6394
    @nedimkulovac6394 2 ปีที่แล้ว

    Hey Nelson - great content! Love to see patterns like this explained.

  • @kamertonaudiophileplayer847
    @kamertonaudiophileplayer847 2 ปีที่แล้ว

    It is a very good designed video and very helpful for software developers.

  • @stevegatspaul
    @stevegatspaul 2 ปีที่แล้ว +2

    what is difference between interface and abstract class?

  • @fonte1184
    @fonte1184 2 ปีที่แล้ว +1

    Hello sir. Please someone recommended your channel for me. Please can you show me how to start with jsp from downloading intellij to running a first program. Thanks for reading

  • @mamadoubobodiallo1216
    @mamadoubobodiallo1216 2 ปีที่แล้ว

    Very useful video bro 👏🏾. Definitely what I need to improve a project I’ve been working on

  • @fdov4
    @fdov4 2 ปีที่แล้ว

    Thanks for your content, great quality. Greetings from Mexico my friend :D

  • @adilwise
    @adilwise 2 ปีที่แล้ว +1

    Hey, great job brother

  • @KangoV
    @KangoV 2 ปีที่แล้ว

    Only subclass if the phrase "is type of" is true. Also, keep this in your head whenever you are designing..,.. "prefer composition over inheritance" and you'll not go far wrong. Also remember a class should only do ONE thing and do that thing well. As soon as you start mixing concerns, your class becomes needlessly complex and breaks the Single Responsibility Principle.

  • @000124021
    @000124021 2 ปีที่แล้ว

    Awesome explanation, thank you!

  • @rounder1000
    @rounder1000 2 ปีที่แล้ว

    Salam aleykoum amigoscode, hi everybody
    Can you make a video of what do you think about remote work. What is your experiences, how did you live the COVID time working from home?
    What are the pros and cons of remote working?
    Thank you and big up !

  • @milanschacht3920
    @milanschacht3920 2 ปีที่แล้ว +1

    What do you think about naming abstract classes like AbstractEmailExractor? I know naming is controversial and sometimes hard. :D

  • @wagnernoise
    @wagnernoise 2 ปีที่แล้ว +1

    Since I was aware of the factory design pattern (very similar to this) I use it whenever I see it can fit :) Thanks for the great video! Cheers

  • @igorsantanas
    @igorsantanas 2 ปีที่แล้ว

    Wow, I liked that a lot, thanks! Strong content!

  • @ianneilagasen2842
    @ianneilagasen2842 2 ปีที่แล้ว +1

    Good content as always, Nelson! Just one question, is it better to make the non abstract methods become static on the abstract class? So that we dont need to instantiate an object. Example, instead of
    new NumberExtractorReport().prepareAndSendReport(path)
    We could do this:
    NumberExtractorReport.prepareAndSendReport(path)

    • @noss403
      @noss403 2 ปีที่แล้ว

      It is not better, but you could do this, if you want.

  • @rajendranaik7317
    @rajendranaik7317 2 ปีที่แล้ว

    Sincere request to create a Java playlist where an order of the videos for a complete beginner sir...

  • @brioquery
    @brioquery 2 ปีที่แล้ว

    Nice and concise.

  • @petroniobonavides3530
    @petroniobonavides3530 2 ปีที่แล้ว

    Wonderful lesson!!!! Thanks a lot

  • @modoulaminceesay9211
    @modoulaminceesay9211 2 ปีที่แล้ว

    I might learn java, i know c++ , python and javascript

  • @Mac1355
    @Mac1355 2 ปีที่แล้ว

    hello
    very nice video about important thread in Java.
    is good review some principies abou t the way to code better all days.
    Many thanks

  • @christopherabelet4672
    @christopherabelet4672 2 ปีที่แล้ว

    Thanks very interresting. However I do not understant thé diffences wirh the interfaces

  • @EnchikO
    @EnchikO 2 ปีที่แล้ว

    Why should I use Open JDK instead of Oracle Open JDK when both can be use commercially. Thank you.

  • @zzzzzzzzzz2588
    @zzzzzzzzzz2588 2 ปีที่แล้ว

    Amazing video. Could you please tell me what theme are you using?

  • @thanhlocnguyen4910
    @thanhlocnguyen4910 2 ปีที่แล้ว

    Nice video ! Can you have a video how to deploy microservices into AWS ?

  • @alexyspol5221
    @alexyspol5221 2 ปีที่แล้ว

    Very good! Thank you

  • @wildjoe6259
    @wildjoe6259 2 ปีที่แล้ว

    thx for real example!

  • @inoobbeyt1031
    @inoobbeyt1031 ปีที่แล้ว

    Can make video on method return abstract class ?

  • @jesper9334
    @jesper9334 2 ปีที่แล้ว

    Thanks for the great video, what color theme are you using?

  • @natanaelsc
    @natanaelsc 2 ปีที่แล้ว

    Thanks bro!

  • @alimrad7760
    @alimrad7760 2 ปีที่แล้ว

    Make a video about design pattern in java, thanks🙏

  • @caffeinejavacode1475
    @caffeinejavacode1475 2 ปีที่แล้ว

    as usual, your example is just Hello World
    *_Can show examples Spring+Abstract class + Generics_*
    I think it will be more useful
    Thank you for your effort

  • @talbiabdelali5914
    @talbiabdelali5914 2 ปีที่แล้ว

    Great bro! Thank you

  • @mikesabiking
    @mikesabiking ปีที่แล้ว

    Instead of making the clean() abstract, would it be better to implement it to return unmodified value. That way existing classes don't need to be modified with clean if it's not needed?

  • @sayyedmuaaz
    @sayyedmuaaz ปีที่แล้ว

    But what is the difference between polymorphism and abstract classes then? Are they serving the same goal?

  • @autoexec5367
    @autoexec5367 ปีที่แล้ว

    Brilliant! :)

  • @alexeygopro1282
    @alexeygopro1282 2 ปีที่แล้ว +1

    Is it possible to use interfaces here instead of abstract classes? What are pros and cons? Thank you for video

    • @TransitionPhase
      @TransitionPhase 2 ปีที่แล้ว

      Depends on your situation. If you would use interfaces in this specific example you can not have a common parse() method and you will have to copy the same code in the parse method of every implementation of the interface. And this exceeds the DRY (dont repeat yourself) principle

    • @noss403
      @noss403 2 ปีที่แล้ว

      @@TransitionPhase Interfaces can have default methods (methods with implementation). Since Java 8.

    • @TransitionPhase
      @TransitionPhase 2 ปีที่แล้ว

      @@noss403 Its true thx for noticing, I forgot that's possible. Then i guess it's the best to use abstract classes in this case cause interfaces are more generic in what they promise to do.

  • @treeteqs
    @treeteqs 2 ปีที่แล้ว

    very clean, machallah

  • @EdwardNorthwind
    @EdwardNorthwind 5 หลายเดือนก่อน

    No. You needed to override the parent method in the EmailExtractorReport class and wrap the parent method in your new clean method. You yourself say that classes should be open for extension but closed for modification.

  • @pavanrai6196
    @pavanrai6196 2 ปีที่แล้ว

    Please launch design patterns course on your website

  • @harrabiyosri1785
    @harrabiyosri1785 2 ปีที่แล้ว

    Thanks so helpful

  • @sovrinfo
    @sovrinfo 2 ปีที่แล้ว

    Thanks!

  • @terabhai4955
    @terabhai4955 2 ปีที่แล้ว

    please make video on tomcat!

  • @hoangtuan4592
    @hoangtuan4592 2 ปีที่แล้ว

    Thank you very much

  • @francksgenlecroyant
    @francksgenlecroyant 2 ปีที่แล้ว

    Hats-Off 🙌🙌🙌

  • @sadiulhakim7814
    @sadiulhakim7814 2 ปีที่แล้ว

    Where should i use final class?

  • @thapelomorare1484
    @thapelomorare1484 2 ปีที่แล้ว

    Do Servlets and jsp

  • @FahadAli-km3ll
    @FahadAli-km3ll 2 ปีที่แล้ว

    As-salamu 'alaykum bro. Can you do a video on CI/CD? :)

  • @trungthanh4134
    @trungthanh4134 2 ปีที่แล้ว

    what font do u use in this video

  • @MudassirKhan-sx9jy
    @MudassirKhan-sx9jy ปีที่แล้ว

    Wa alaikum Salam.

  • @Danish_Khan_
    @Danish_Khan_ 2 ปีที่แล้ว +1

    Please please, guid me which tech skill i should learn so I land a job in halal compony. There are so many haram stuff in software development and many tech industry. Please please guid me. ❤️🙂

  • @brimabah2163
    @brimabah2163 2 ปีที่แล้ว

    I would like to join your boot camp

  • @traviswhitten6452
    @traviswhitten6452 2 ปีที่แล้ว

    Why make the PATTERN static?

  • @raulrahaman9863
    @raulrahaman9863 2 ปีที่แล้ว

    I don’t understand anything after the reading of the files part :(

  • @bakre_dev8728
    @bakre_dev8728 ปีที่แล้ว

  • @aayush5474
    @aayush5474 2 ปีที่แล้ว

    when to abstract class and when to use interface?

  • @nikhiljose2029
    @nikhiljose2029 2 ปีที่แล้ว

    Is regex testing available in intellij community?

  • @94JulianDavid
    @94JulianDavid ปีที่แล้ว

    Why don't use interfaces ?

  • @TeslaDo
    @TeslaDo 2 ปีที่แล้ว

    Abscract / abstract? Is it only a typo or a slang?

  • @noss403
    @noss403 2 ปีที่แล้ว

    Wouldn't it be better to write code like this:
    (in parse method)
    if(!scanner.hasNext())
    {
    return "Empty file";
    }
    scanner.nextLine();
    ....

  • @erickshaffer6615
    @erickshaffer6615 ปีที่แล้ว +1

    Says he won't do the typical animal example. Proceeds to do exactly that

  • @rabbyhossain9537
    @rabbyhossain9537 2 ปีที่แล้ว

    How much salary give your company for you

  • @TheStrategist314
    @TheStrategist314 2 ปีที่แล้ว

    how come when I click the discord, it doesn't work?

  • @travelers4178
    @travelers4178 2 ปีที่แล้ว

    First comment ☺️
    Assalamu aleykum my brother 👍 good video! We need to refresh our memory all the time.

  • @USONOFAV
    @USONOFAV 2 ปีที่แล้ว

    what's the difference between Abstract classes and Interface with default methods. Anyone?
    You can have common functionality on both abstract class and interface.

    • @mychellmotta6639
      @mychellmotta6639 2 ปีที่แล้ว

      You can't implement methods on interfaces, so in his example, he would have duplicate code on both NumberExtractor and NumberExtractor with the parse method.

    • @94JulianDavid
      @94JulianDavid ปีที่แล้ว

      @@mychellmotta6639 Since java 8 you can have default methods in interfaces

  • @user-iy9ku8hk3x
    @user-iy9ku8hk3x 2 ปีที่แล้ว +1

    whos deliting my comments?

  • @jeseviso-s2u
    @jeseviso-s2u 2 ปีที่แล้ว

    Los Pollos Amigos

  • @blockbuster_7103
    @blockbuster_7103 2 ปีที่แล้ว

    Use kotlin

  • @MuslimMan377
    @MuslimMan377 2 ปีที่แล้ว

    Him : salam alaikom
    Me : subscribe, like

  • @flyingrecordofficial
    @flyingrecordofficial 2 ปีที่แล้ว

    Mashaallah bro

  • @beshbenesh1796
    @beshbenesh1796 2 ปีที่แล้ว

    yes no more cats ands dogs..... :)

  • @redhotbits
    @redhotbits ปีที่แล้ว

    just dont use them

  • @abdullahdaoud
    @abdullahdaoud 2 ปีที่แล้ว

    Thank you so match , this is very great 🤍

  • @valarchandran6581
    @valarchandran6581 2 ปีที่แล้ว

    @amigoscode nice explanation

  • @Another0neTime
    @Another0neTime 2 ปีที่แล้ว

    Great example, thanks for breaking it down. Cheers.