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 overloading
In multiple inheritance , to create sub class object , is there need to create objects for its superclasses??? in java and c++ both. Actually i have some information that is , all available members from its superclasses , memory created in subclass obj , so no need to create object for its superclasses...??? Thanks in Advance
Which keyword is written to use a variable declared in one class in the other class?
Why is polymorphism important in oop?
what is virtual destructor
What is memory leak and memory corruption?
What normal C constructs work differently in C++?
What is function overloading?,describe it with the example.
What are oops functions?
what type of question are asked in thoughtworks pair programming round ?
What is abstraction in oops with example?
What is overloading in oop?