Practice cloning
Comments (13)
- Popular
- New
- Old
You must be signed in to leave a comment
matemate123
3 March 2023, 20:07
Doable tasks!
+1
Ibrahim
17 January 2022, 10:23
Shallow copy vs Deep copy and their differences when cloning
https://www.geeksforgeeks.org/clone-method-in-java-2/
+2
Jurij Thmsn
16 June 2021, 14:16
How is nr3 "easy" ? Its the hardest on this page.
Anyways. Joshua Bloch says, cloning like this is a bad idea. You should rather use Copy constructors and factories. So its probably not worth spending tooooo much effort on this topic.
+2
Andrei
24 March 2021, 09:16
For the "Prevent cloning" task ask yourself - when you're trying to clone C, if you can't use super.clone() from B class (as this will return an error), what source of information can you use for the new clone?
And in B class, if you're not supposed to clone this class, what should you return?
0
Andrei
24 March 2021, 09:20
I solved it in about 80 minutes, 41 attempts and many google searches without results because it is a very specific situation so I ended up using the mentor solution. But it was a good exercise, because all of the googling and trying to understand the task made me learn new things and better understand the cloning thingy/situation.
+2
Mike McKenna
6 March 2021, 17:47
Hi Luyi,
Thank you
0
Shilpa nori
24 February 2021, 23:45
Is it just me or is anyone else struggling to understand the logic ? 😌
0
Deng Xin
25 May 2021, 01:33
me too, I found it is not easy to deal with even the easy one
0
Hoist
30 October 2023, 00:41
Co Pilot helps ; -- and reads me the debug via audio ... of course supplemental info. Codegym is a totally great platform and I have been here for 4 years. My 2nd lap around since I didn't finish .... tenacity for the win )
0
Luyi
8 October 2019, 11:38
This link can be helpful:
https://www.techiedelight.com/shallow-copy-vs-deep-copy-java/
+21
Thomas
28 May 2020, 06:44
Thanks
+2
Simphiwe Full Stack Developer
12 April 2023, 17:40
Good material
0
Hoist
30 October 2023, 00:42
Thanks for the post !
0