Object Cloning in Java | Shallow vs DEEP Copy | Clone Method

Поделиться
HTML-код
  • Опубликовано: 10 сен 2024
  • Hi everyone. In this video we will be dealing with copying an object in java.
    We will go through :
    * What is a reference copy?
    * Problem with reference copy?
    * How to implement a clone method?
    * What is a shallow copy?
    * Problem with shallow copy?
    * What is a deep copy?
    * Mutable vs Immutable behaviour in cloning.
    We will understand all of these with the help of a practical coding example.
    **Do like, share and subscribe to the channel if you find the video helpful. It will be a great motivation. Thanks✌️

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

  • @sudhanshurranjan
    @sudhanshurranjan 4 дня назад

    Nice explanation.Finally I understood.

  • @bhanukhandelwal8033
    @bhanukhandelwal8033 Месяц назад

    You earned my subscription from the very first video bro... I had been searching for the solution since yesterday but could not understand. Thank you for making the concept crystal clear with all possible scenarios.

  • @chnihar4123
    @chnihar4123 Месяц назад

    Finally the video I am looking for. Thank you bro ❤

  • @rohitsharma-xt8qe
    @rohitsharma-xt8qe 23 дня назад

    Good Explanation and keep it up.

  • @novemberrain5462
    @novemberrain5462 Месяц назад

    You are good teacher .All the best.

  • @letthegamebegin4306
    @letthegamebegin4306 Год назад +1

    amazing explanation. so clear. thank you very much.

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

    bahut badiya explain in simple way You'r best

  • @deepakkumarsahu4109
    @deepakkumarsahu4109 5 месяцев назад

    Thank you, finally I understood this concept

  • @ArshadKhan-zf6xp
    @ArshadKhan-zf6xp Год назад

    Simple short ,very good explanantion ..Thank you

  • @kartikeypandey5920
    @kartikeypandey5920 2 месяца назад +1

    Very good and complete explanation

  • @start1learn-n171
    @start1learn-n171 15 дней назад

    Tq

  • @SriVarshithaGorle
    @SriVarshithaGorle 3 месяца назад

    BROOOOOO!! SOOO GOOD ! How the hell do u still have such low subscribers.. T-T . I understood it sooo well, thank you so much

  • @azimrahman3584
    @azimrahman3584 4 месяца назад

    Amazing video,clear explaination. I think you should start java full stack course,you have given better explaination comparision to Durgesh.

  • @user-yt4vb8ii2f
    @user-yt4vb8ii2f 11 месяцев назад

    bhaiya, crystal clear hogya.

  • @shubhammishra229
    @shubhammishra229 Год назад +1

    very good explained sir 😀

  • @S.R10000
    @S.R10000 6 месяцев назад

    Finally understood this concept

  • @zhunzargulhane6741
    @zhunzargulhane6741 10 месяцев назад

    Best video explantion.

  • @routhuaravind6006
    @routhuaravind6006 11 месяцев назад

    just now i have subscribed
    Thank you
    nice explanation but much appreciated if the length is little bit less

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

    Very nice explanation sir.. thanku 😊

  • @shubhamborute2001
    @shubhamborute2001 9 месяцев назад

    Best Explanation.. 💯👍

  • @jeefrontrank9912
    @jeefrontrank9912 9 месяцев назад

    really precise

  • @viveksharma-lp7hi
    @viveksharma-lp7hi 4 месяца назад

    Nice explanation

  • @ashishsingh8222
    @ashishsingh8222 4 месяца назад

    good explanitation

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

    nice explaination

  • @Shibu2822
    @Shibu2822 3 месяца назад

    Bro iss se acha video youtube nahi hai...........

  • @pawankumar-ds2sb
    @pawankumar-ds2sb Год назад

    Reference hi copy hota uska entire object copy nhi hota Iska matlb kya hua sir please explain sir

    • @prog_learner2577
      @prog_learner2577  Год назад +1

      Student obj1 = new Student ();
      yaha obj1 jo hai wo actually ek object nahi hai..object ka reference hai yaani ki actual object ka memory address store karta hai..
      aur agar hum isi reference ko kisi aur variable mai copy karenge jaise
      Student obj2 = obj1;
      to ab obj2 mai bhi yehi memory address(reference) store ho jaayega jo ki wahi original object ko refer kar raha hoga..yaha koi naya object nahi banega
      yahi hai reference copy

    • @pawankumar-ds2sb
      @pawankumar-ds2sb Год назад

      Thank u so much sir 😊

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

    Can we clone static variables

    • @prog_learner2577
      @prog_learner2577  11 месяцев назад +1

      static variables are maintained at class level rather than object level so even if you clone it all of the objects will still be referring to the same variable