ex-04-02

来自「Programming Csharp Source Code(代码) Prog」· 代码 · 共 27 行

TXT
27
字号
//Example 04-02: Passing values into SomeMethod( )

using System;

public class MyClass
{
   public void SomeMethod(int firstParam, float secondParam)
   {
      Console.WriteLine(
         "Here are the parameters received: {0}, {1}",
         firstParam, secondParam);
   }

}

public class Tester
{
   static void Main()
   {
      int howManyPeople = 5;
      float pi = 3.14f;
      MyClass mc = new MyClass();
      mc.SomeMethod(howManyPeople, pi);
   }

}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?