using System; using System.Collections.Generic; using System.Text; namespace WindowsFormsApplication3 { public { public public public Class1(int a,int b) { this.a = a; this.b = b; } public { return a.ToString() + “+” + b.ToString() + “i”; } public { Class1 c = new c.a = a1.a + a2.a; c.b = a1.b + a2.b; return c; } } } |
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; namespace WindowsFormsApplication3 { public { public Form1() { InitializeComponent(); } private { Class1 c1 = new Class1 c2 = new Class1 c3 = c1 + c2; MessageBox.Show(c3.tostring()); } } } |