Shallow vs Deep Copy in Java

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

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

  • @shiloovrani4574
    @shiloovrani4574 6 лет назад +27

    It is great that you speak slowly and clearly.
    In most cases Google's automatic translation understands you well.
    This allows people around the world to view these lectures.
    Thanks

    • @MarcusBiel
      @MarcusBiel  6 лет назад +7

      Actually, the subtitles you see in my videos are not done by Google, but manually added by my editor. They just contain some errors, but I decided to leave them in and spent the time on producing more content :)

    • @shiloovrani4574
      @shiloovrani4574 6 лет назад +3

      I saw that there were subtitles in English, but I was watching subtitles in Hebrew.
      I assume that translation is more successful when it is made from your captions rather than through automatic speech recognition. Either way, you speak slowly and clearly.
      Thank you

  • @Hafiyyanc69
    @Hafiyyanc69 4 года назад +3

    Vielen Dank !! Ich hatte dieses Thema in Programmierung 1 nicht wirklich verstanden aber dieses Video hat das Thema tiefe und flache Kopie hervorragend erklärt 👍

  • @Ali-mi9up
    @Ali-mi9up 5 лет назад

    Hands down the best explanatory video I've seen so far

  • @oscarllamas6
    @oscarllamas6 6 лет назад +3

    excellent, I noticed that what I needed was a deep copy, thank you very much for this contribution!

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

      Great that I was ableo to help you! :)

  • @dilipjain9581
    @dilipjain9581 8 лет назад +6

    You are my favourite faculty. awesome video...

  • @thexxmaster
    @thexxmaster 7 лет назад +3

    Brilliant, very simple yet accurate.

  • @eduardoserrano5453
    @eduardoserrano5453 6 лет назад +2

    Marcus you did an excellent job on this video. Thank you very much!

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

      You're welcome! Great that you liked it!

  • @badbadboy5657
    @badbadboy5657 4 года назад +3

    lol, "only to find out that his mommy has joined him." that would be funny.

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

    simple explanation & very professional

  • @Aybmhm
    @Aybmhm 7 месяцев назад

    Thanks, its a clear lesson that we can understand !

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

    clear explanation. I used this logic in python.

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

    hi Marcus,
    Thanks for sharing this video tutorial.
    But Please provide the real live project example where we can use the shallow copy and deep copy.

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

      1. In 99% of the cases, use an Immutable (see my next video).
      2. A shallow copy you will use intuitively. But sometimes, that is not enough, because, as I showed in my example, this can lead to unwanted side effects. In these cases consider creating a deep copy. However, often it is also enough to just deep copy a part of the object, like I did with address in the video.

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

    Super smooth explanation ...❤️

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

    best explanation ever, Thank you.

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

    Great explanation

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

    thanks a lot for this wonderful explanation.

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

    thank you for this cool video.

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

    A true Craftsman

  • @jesseschlicklin4923
    @jesseschlicklin4923 6 лет назад +2

    This is awesome! Subscribed.

  • @ΑντρέαςΣωτηρίου-π8γ

    god bless you

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

    Are you using a different Person constructor to construct the mother object?

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

    Good Video!!

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

    Thank you!

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

    Object is a simple coffee bean?

  • @Tony.Nguyen137
    @Tony.Nguyen137 3 года назад

    I don’t get it. The constructor has only one parameter: Person otherPerson. But when u create the Person object you put new name and new address in the constructor?!

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

    1.As we know we cannot instantiate Abstract class then why there is no restriction for taking constructor in Abstract class?

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

      Yes you cannot instantiate an Abstract class, but still, when a concrete class, extending the abstract class gets created, of course also the abstract part needs to be created. using super() (plus any arguments needed) you can call it from the constructor of your concrete class. But as you will see, this very soon gets very confusing. Avoid too complex inheritance hierarchies, and avoid inheritance altogether!

  • @karthikg108
    @karthikg108 7 лет назад +3

    Thank you so much sir :)

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

    Thanks!

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

    Nice !

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

    thanks a lot sir

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

    good lad

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

    among us?

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

    Everything cool up to minute 4, then I got confused maybe it is because I am such a beginner.

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

      Confused by what?

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

      @@MarcusBiel I realized that I skipped a few videos previous to this one, I will watch those skipped and rewatch this one. Maybe that will help. Thanks anyway !!!!

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

      @@MarcusBiel There's going to be a city class too right? for otherPerson in the deep copying

  • @a.m.m6713
    @a.m.m6713 4 года назад

    good

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

    A M O G U S

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

    Horraaaay!

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

    2:37

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

    I understood the diference between the copies but stil can't know how to do a deep copy of my object.

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

      It is an entire Java course, and this had already been explained by me in the past. Please watch this video:
      ruclips.net/video/0_V-z6QcaWc/видео.html
      It shows different strategies of how to create a deep or shallow copy.