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

Why are pointers not used in c++?

1190


What is c++ 11 and c++ 14?

1109


What is the difference between realloc() and free() in C++?

1001


What is the benefit of learning c++?

1044


What is methods in oop?

1033


to find out the minimum of two integer number of two different classes using friend function

2184


What is ofstream c++?

1150


What is the main use of c++?

1167


What is c++ redistributable?

1298


When does a name clash occur in c++?

1213


How do you invoke a base member function from a derived class in which you have not overridden that function?

1185


What is a vector c++?

1250


What does n mean in c++?

1237


Can bst contain duplicates?

1243


What is array in c++ pdf?

1284