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 the difference between class to class type
conversion and copy constructor ?

Answer Posted / sujatha

CLASS TYPE TO CLASS TYPE:

In class to class type this can be achieved through either
by using TYPE CONVERSIONS OR BY USING CONSTRUCTORS.
here one class object is convrted into another class object


COPY CONSTRuctor:

here we r copying already existing object value to new
object of the same type.

and copy constructor will get called when we are creating
new object of the class at the same time we r intializing
the object with the already existing object.
ex:

A a1; //a1 is object of class A
A a2=a1 //a2 object of class A. a2 is a new object and a1
//is already existing object.

Is This Answer Correct ?    8 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why polymorphism is used in oops?

1053


What are the 5 oop principles?

1127


Which is better struts or spring?

1058


i=20;k=0; for(j=1;k-i;k+=j<10?4:3) { cout<

1861


what is the drawback of classical methods in oops?

3381


How to improve object oriented design skills?

1017


What is object and example?

1178


Give an example where we have to specifically use C programming language and C++ programming language cannot be used?

1636


What are constructors in oop?

1183


What are objects in oop?

1109


write string class as your own class in java without using any built-in function

2502


What is polymorphism and types?

1107


What are two types of polymorphism?

1077


Why is static class not inherited?

1108


Can a varargs method be overloaded?

1107