what is the difference between class to class type
conversion and copy constructor ?
Answers were Sorted based on User's Feedback
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 |
Answer / ganesh
this copy constructor is coping already existing object
values of same type
| Is This Answer Correct ? | 1 Yes | 1 No |
what is oops
Can a destructor be called directly?
Explain polymorphism? What r the types of polymorphism? pls give examples?
What are the OOPS concepts?
106 Answers A1 Technology, Bajaj, CTS, EDS, HP, Infosys, Intel, Microsoft, MNC, Persistent, PlanetSoft, ProConstructor, TCS, Virtusa, Wipro, YSoft Solutions,
What is the real life example of polymorphism?
What is Dynamic Polymorphism?
There are 2 classes defined as below public class A { class B b; } public class B { class A a; } compiler gives error. How to fix it?
what is the diffrence between c# and c++
Conversion from a basic type to a class type may be achieved using______________
What is a class in oop?
Example for 4 pillar of oops like, Inheritance,Poly,Abstraction,Encabsulation ?
What is the difference between inheritance and polymorphism?