方法的调用示例

来源:互联网 发布:快速制作效果图软件 编辑:程序博客网 时间:2024/06/11 18:52

using System;

class MathTest
{
 public int Square(int x)
 {
  return x*x;
 }
}

class MathClient
{
 public static void Main()
 {
  MathTest Math = new MathTest();
  int x = Math.Square(10);
  Console.WriteLine(x);
  Console.ReadLine();
 }
}

原创粉丝点击