
using System;
namespace Method
{
class MainApp
{
// Plus() 메서드
public static int Plus (int a, int b) // 매개변수: a, b
{
return a + b;
}
public static void Main ()
{
int result = MainApp.Plus(3, 4); // 인수: 3, 4
Console.WriteLine(result);
}
}
}
[실행 결과]
7
▪ 참고: Hello Fruit - 메서드 오버로딩 등
▪ 참고: Hello Fruit - 명명된 인수 등
▪ 참고: Hello Fruit - static 필드, 메서드