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 ?

Answers were Sorted based on User's Feedback



what is the difference between class to class type conversion and copy constructor ?..

Answer / 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

what is the difference between class to class type conversion and copy constructor ?..

Answer / ganesh

this copy constructor is coping already existing object
values of same type

Is This Answer Correct ?    1 Yes 1 No

Post New Answer

More OOPS Interview Questions

Contrast OOP and SOA. What are tenets of each?

1 Answers   Siebel Systems, Wipro,


How do you achieve runtime polymorphism?

0 Answers  


Why polymorphism is used in oops?

0 Answers  


What is a class in oop?

0 Answers  


Example for 4 pillar of oops like, Inheritance,Poly,Abstraction,Encabsulation ?

3 Answers  


What does enum stand for?

0 Answers  


what is difference between objects and function

1 Answers  


What is property in oops?

0 Answers  


How do you make derived class as an abstract class?

1 Answers   Convergys, TCS,


what are the ways in which a constructors can be called?

2 Answers   TCS,


Program to print 0 to 9 in cross order

3 Answers  


What are the 3 principles of oop?

0 Answers  


Categories