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

Why interface is used?

0 Answers  


which is platform independent device used in computers

2 Answers  


diff between Virtual mathod and abstract method?

1 Answers  


what is the difference between javap and jad utility

1 Answers   Wipro,


1.what are two type of classe members called? 2.what is data hiding and data encapsulation? 3.how do you make a class member visible aouside its class? 4.what is the default visibility of a class data member? 5.what are the advantages of oop over the structured programing?

6 Answers  






c++ program to swap the objects of two different classes

0 Answers  


What is a template?

7 Answers  


Why many objects can working together? How objects working togetherM I want to see example code.

2 Answers  


what is ltti

1 Answers   Unisys,


Write a c++ program to display pass and fail for three student using static member function

0 Answers  


Differences between inline functions and non-inline functions?

4 Answers   Ness Technologies,


JAVA is FULLY OBJECT ORIENTED PROGRAMING LANGUAGE?

3 Answers  


Categories