how can u apply shallow cloning and deep cloning to create
object?
Answer / kiran sonaje
Hi,
Please refer below link for shallow cloning
http://www.java2s.com/Code/Java/Language-
Basics/ShallowCopyTest.htm
and for deep cloing
http://www.java2s.com/Code/Java/Language-
Basics/DeepCopyTest.htm
Please please observe clone method to get more
clarification between deep and shallow cloning
| Is This Answer Correct ? | 2 Yes | 3 No |
What is Co-Variant return type in method overriding?
What happens to the Exception object after handling an exception?
Why is whitespace important?
Can we call a non-static method from inside a static method?
What is public static void main?
7) Suppose there is Student class like class student { int age; string name; } We want to store these objects in a HashMap. Do we need to override any methods in Student class? If any which ones and why? what if i just override equals or just hashcode? what will be the results in both the cases?
What is equals method in java?
Explain the importance of throws keyword in java?
Can we call the run() method instead of start()?
What is meant by anonymous class?
What is string :: npos?
Why arraylist is used in java?