Created
November 27, 2021 11:49
-
-
Save ok1003/8af4849e1488148d7305ff3477c46f3a to your computer and use it in GitHub Desktop.
クラス.メソッド()使いたい
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
namespace ConsoleApp1 | |
{ | |
//クラス | |
class Class1 | |
{ | |
//メソッド(引数) | |
static string Method(string name1, int num1) | |
{ | |
return name1 + ",さんの年齢って" + num1 + "歳でしたっけ?"; | |
} | |
//mainクラス | |
static void Main() | |
{ | |
//クラス.メソッド | |
var message = Class1.Method(num1: 26, name1: "田中"); | |
Console.WriteLine(message); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment