Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How does the assignment work?

assignment
0
Posted

How does the assignment work?

0

For object types just the reference to the object value is copied. For primitive types the value itself is copied. Since values can be very big (think of arrays of structs with string elements) value copies can be time consuming. In pure object oriented languages the effect of independent objects after the assignment is reached in a different way: Every change to an object creates a new object and therefore the time consuming copy takes place with every change. Because usually changes to an object are more frequent than assignments this approach can be even more time consuming than the approach using value copies for the assignment.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123