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✌️
Nice explanation.Finally I understood.
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.
Glad I could help
Finally the video I am looking for. Thank you bro ❤
😇😇
Good Explanation and keep it up.
You are good teacher .All the best.
Thanks a lot
amazing explanation. so clear. thank you very much.
bahut badiya explain in simple way You'r best
Thank you, finally I understood this concept
i am glad it was helpful😌
Simple short ,very good explanantion ..Thank you
Very good and complete explanation
Glad it was helpful!
Tq
BROOOOOO!! SOOO GOOD ! How the hell do u still have such low subscribers.. T-T . I understood it sooo well, thank you so much
i am glad it was helpful😌
Amazing video,clear explaination. I think you should start java full stack course,you have given better explaination comparision to Durgesh.
thank you😇
bhaiya, crystal clear hogya.
very good explained sir 😀
Finally understood this concept
i am glad it was helpful😌
Best video explantion.
just now i have subscribed
Thank you
nice explanation but much appreciated if the length is little bit less
thank you😇
Very nice explanation sir.. thanku 😊
i am glad it was helpful😌
Best Explanation.. 💯👍
thank you😇
really precise
Nice explanation
thank you 😇
good explanitation
thank you😇
nice explaination
thank you!
Bro iss se acha video youtube nahi hai...........
thank you😇
Reference hi copy hota uska entire object copy nhi hota Iska matlb kya hua sir please explain sir
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
Thank u so much sir 😊
Can we clone static variables
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