public class Test
 {
  public static int test = 0;

  Test()
  {
   test++;
  }

  Test(int i):this()
  {
   test += i;
  }
//test code here:
Console.WriteLine(Test.test);

//第二个代码
 public class Test
 {
  public static int test = 0;

  static Test()
  {
   test++;
  }

  private Test(int i)
  {
   test += i;
  }
//test code here:
Console.WriteLine(Test.test);

//比较清晰的了解了essential.net中讲到的initializar和constructor。

2004年4月15日 13:41

相关文章:

  • 2022-02-10
  • 2021-07-10
  • 2021-12-24
  • 2022-01-17
  • 2021-07-27
  • 2021-10-26
  • 2021-10-26
  • 2022-12-23
猜你喜欢
  • 2023-03-17
  • 2022-12-23
  • 2021-06-26
  • 2022-12-23
  • 2023-02-15
  • 2021-06-28
  • 2022-12-23
相关资源
相似解决方案