What comes to mind when someone mentions a shallow copy in java?



What comes to mind when someone mentions a shallow copy in java?..

Answer / Narayan Lal

A shallow copy in Java refers to the process of creating a new object and initializing its fields with the reference values (i.e., pointers) of the existing object's fields, instead of creating a deep copy of the object's internal data structure. Shallow copies are often performed using the Object.clone() method or assignment operator (=).

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Core Java Interview Questions

What is Remote Interface ?

6 Answers   CTS,


What is an array and a vector? How they different from each other?

4 Answers  


There are 2 methods in a class. Both have the same method signature except for return types. Is this overloading or overriding or what is it?

9 Answers   KPIT,


what do you mean by classloader?

1 Answers  


Why there are some null interface in java? What does it mean?

1 Answers  


What are the drawbacks of reflection?

1 Answers  


Difference between linkedlist and arraylist.

1 Answers  


What is difference between module and function?

1 Answers  


What is the purpose of assert keyword used in jdk1.4.x?

1 Answers  


How can an exception be thrown manually by a programmer?

1 Answers  


Which are the two subclasses under exception class?

1 Answers  


What method is used to compare two strings ?

4 Answers  


Categories