Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

What is Copy Constructor?

Answer Posted / shrikant kale

I think the answer to this is very interesting.

For one, I believe that in Java all objects are on the
heap, and while you don't have pointers, you do
have "References". References have copy symantics and java
internally keeps track of reference counts so that it's
garbage collector knows whats safe to get rid of.

Since you only access objects through copyable references,
the actual number of times you need to copy an object is
greatly reduced (for example, in C++ just passing an object
to a function (by value) results in new objects being copy
constructed, in Java only the reference to the object is
passed). The designers probably figured that clone() would
be enough for the remaining uses.

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Does dev c++ support c++ 11?

1018


Mention the ways in which parameterized can be invoked. Give an example of each.

1064


Explain the static storage classes in c++.

1271


What are arithmetic operators?

998


What is encapsulation in simple terms?

1040


Mention the purpose of istream class?

1113


How do you answer polymorphism?

1062


What does flush do c++?

1065


How can you quickly find the number of elements stored in a dynamic array? Why is it difficult to store linked list in an array?

1038


Does c++ have arraylist?

1019


Assume studentNames and studentIDs are two parallel arrays of size N that hold student data. Write a pseudocode algorithm that sorts studentIDs array in ascending ID number order such that the two arrays remain parallel.

2202


What is pointer with example?

1060


Can we distribute function templates and class templates in object libraries?

1081


What are the two types of comments?

999


How does a copy constructor differs from an overloaded assignment operator?

1043