G
Guest
I have a question about the following code in C#:
AddClass1 op1=new AddClass1();
op1.val=5;
AddClass1 op2=new AddClass1();
op2.val=3;
AddClass1 op3=op1+op2;
Console.WriteLine(op3.val);
The answer is of course 8. but my question is:
Why don't i need to initialize op3 in the form of AddClass1 op3=new
AddClass1();
like with op1 and op2 ?
AddClass1 op1=new AddClass1();
op1.val=5;
AddClass1 op2=new AddClass1();
op2.val=3;
AddClass1 op3=op1+op2;
Console.WriteLine(op3.val);
The answer is of course 8. but my question is:
Why don't i need to initialize op3 in the form of AddClass1 op3=new
AddClass1();
like with op1 and op2 ?