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
Why do we use oops?
What is overriding vs overloading?
Write A Program to find the ambiguities in Multiple Inheritance? How are they resolved.(Virtual Functions)
What is oops concept with example?
What is object-oriented programming? Webopedia definition
Why do we need oop?
What is oops with example?
Advantage and disadvantage of routing in telecom sector
Can abstract class have normal methods?
Which type does string inherit from?
Write a java applet that computes and displays the squares of values between 25 and 1 inclusive and displays them in a TextArea box
How to handle exception in c++, For example in a functions i am assigning memory to some variables and also in next instructions in am dividing one variable also. If this functions generates a error while allocating memory to those variable and also while dividing the variable if i divide by zero then catch block how it will identify that this error has cone from perticular instruction
Which language is pure oop?
assume the program must insert 4 elements from the key board and then do the following programs.sequential search(search one of the elements),using insertion sort(sort the element) and using selection sort(sort the element).
What is basic concept of oop?