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
What is an interface in oop?
How do you achieve polymorphism?
what are the ways in which a constructors can be called?
Give an example where we have to specifically use C programming language and C++ programming language cannot be used?
Why is there no multiple inheritance?
What is a superclass in oop?
What is encapsulation with example?
What are the three parts of a simple empty class?
What is the real time example of encapsulation?
How does polymorphism work?
any one please tell me the purpose of operator overloading
What is overloading in oops?
What is interface? When and where is it used?
Can enum be null?
What do you mean by abstraction?