- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What is the difference between shallow copy and deep copy in Java?
When we copy an object, a shallow copy is where only the outer object is copied. For example, if we have an object named sample and it contains another object named subSample then if you copy this only the contents of the sample are copied.
When we copy an object deep copy is where whole object structure is copied i.e. if you copy sample the contents of both sample and subSample were copied.
- Related Articles
- Deep Copy and Shallow Copy in Java
- Copy - Shallow and deep copy operations in Python
- What is Shallow Copy and how it is different from Deep Copy in C#?
- Python Shallow and Deep Copy operations
- What is shallow copy? Explain with an example in Java.
- What is the difference between baking, roasting, shallow frying and deep frying?
- Return a shallow copy of IdentityHashMap in Java
- What is deep copy? Explain with an example in Java.
- How to shallow copy the objects in JavaScript?
- How do you make a shallow copy of a list in Java?
- How to create a shallow copy of the BitArray in C#?
- How to create a shallow copy of Hashtable in C#?
- How to create a shallow copy of ArrayList in C#?
- Difference between Copy and Derived view in SAP HANA
- Difference Between Copy Constructor and Assignment Operator in C++

Advertisements