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
Can enum be null?
can inline function declare in private part of class?
Which method cannot be overridden?
Can abstract class have normal methods?
What do you mean by variable?
Why we use classes in oop?
What is interface in oop?
What is class and example?
What is variable example?
What is inheritance and how many types of inheritance?
How oops is better than procedural?
is there any choice in opting subjects like 4 out of 7
Give two or more real cenario of virtual function and vertual object
What is object and class in oops?
Which type does string inherit from?