using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
Complex z1 = new Complex(73, 89);
Complex z2 = new Complex(21, 16);
Complex z3 = Complex.Add(z1, z2);
}
class Complex
{
public double a;
public double b;
public Complex(double real, double imagi)
{
a = real;
b = imagi;
}
public static Complex Add(Complex z1, Complex z2)
{
return new Complex(z1.a + z2.a, z1.b + z2.b);
}
}
}
}
不能理解静态函数中,用自身类定义类内的函数,应该怎么理解?