how can u apply shallow cloning and deep cloning to create
object?

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is immutable class in java?

508


How to sort elements in a parallel array in java?

503


What is the full meaning of java?

529


What do you mean by ternary operator in java?

556


Can an integer be null java?

553






What is a null check?

535


Is hashset ordered?

547


What are the supported platforms by java programming language?

565


What are the data types supported by java? What is autoboxing and unboxing?

546


Does substring start with 0?

552


What is incompatible types in java?

533


What is method reference?

515


Does java support function overloading, pointers, structures, unions or linked lists?

603


How do you check whether the list is empty or not in java?

509


What is codebase?

532