Question
What is the difference between deep and shallow copy?

Answers

- Shallow copy is used when a new instance type gets created and it keeps the values that are copied in the new instance. Whereas, deep copy is used to store the values that are already copied.
- Shallow copy is used to copy the reference pointers just like it copies the values. These references point to the original objects and the changes made in any member of the class will also affect the original copy of it. Whereas, deep copy doesn’t copy the reference pointers to the objects. Deep copy makes the reference to an object and the new object that is pointed by some other object gets stored. The changes made in the original copy won’t affect any other copy that uses the object.
- Shallow copy allows faster execution of the program and it depends on the size of the data that is used. Whereas, deep copy makes it slower due to making certain copies for each object that is been called.   Your Comment




More Software Questions..
What is the inputsplit in map reduce software?

What is software configuration management?

What Is Java Api For Xml-based Rpc (jax-rpc)?

How can you implement fine-grained auditing?

What is IBM’s simple explanation for Big Data’s four critical features?

What is static synchronized method in JDBC API? Give an example?

What does the NULLIF function do?

What happens if a start method is not invoked and the run method is directly invoked?

Should we override finalize method

what is the difference between mysql_fetch_array and mysql_fetch_object?

How will XML affect my document links?

Why to use Style Sheets?

What are Filters in MVC?

Can you explain Application layer in OSI model?

How to define new testplan attributes?

What are the minimum system requirements to run Photoshop? Is it possible to run Photoshop over linux?

Which oracle package is used to manage the oracle lock management services?

What is Latch Up? Explain Latch Up with cross section of a CMOS Inverter. How do you avoid Latch Up?

What is marker interface?

What types of partitioning are there for BW?



Search
Can you Answer!!
  • Q The making data or research more measurable and specific so that other scientists can repeat or replicate the study is known as:
  • Q      Explain what is PowerShell?
  • Q What is the difference between localtime() and gmtime() functions
  • Q What is the normal body temp?
  • Q What is modeling and texturing?
  • Q How can social media be used for marketing?
  • Q What are the factors that influence software quality?
  • Q What is vdl (view definition language) explain?
  • Q A container with liquid nitrogen is left in a laboratory, and its temperature is being recorded over a long period. The recorded temperature shows variations. Why?
  • Q What happens when two clients try to access the same file in the HDFS?
  • Q anyone whos has systematically examined faces will have perceived a prepondreance although not a proliferation of asymmtry.whether or not the expression is volitinal and self controlled or spontaneous appears to predict facial asymmetry as does the type of emotion protrayed.positive emotions are usually displayed symmetrically although a left sided representation of a negative emotion is more common.posed expressions and negative emotions are less likely to be symmetrically represented. state the below sentences either true or false ? 43.an angry person is more likely to have a lopsided expression than someone who is smiling 44.a deliberately assumed facial expression will always be asymmetrical 45.an actor is likely to smile symmetrically when acting 46.more self conscious people are likely to have less asymmetrically facial expressions than those who are less aware