Answer Posted / chandra
to achieve synchronization with the normal languages like c.
for example int a=10,b=30,c;
c = a+b ;
the above operation is possible in c as well as c++.bcos
the variables declared are primitive types.
If u want to do same thing for user defined datatypes, i
can say objects, we have to overload the operators.
For ex:
Assume that u created one class
Class A
and u have created objects
A obj1(10),obj2(30),obj3;
and u want the add 2 objects and result must be stored in
another object.
then u have to overload the operator + for class A.
obj3 = obj1 + obj2 ;
| Is This Answer Correct ? | 7 Yes | 0 No |
Post New Answer View All Answers
What is the difference between encapsulation and polymorphism?
Why do we use encapsulation in oops?
What is difference between data abstraction and encapsulation?
What is destructor example?
What is an interface in oop?
Write a C++ program without using any loop (if, for, while etc) to print prime numbers from 1 to 100 and 100 to 1 (Do not use 200 print statements!!!)
What is super in oop?
any one please tell me the purpose of operator overloading
what is graphics
What causes polymorphism?
write a program to find 2^n+1 ?
Why do we use class?
Can you inherit a private class?
What is constructor in oop?
What is an advantage of polymorphism?