「C#」静的クラス(static class)を使うサンプル
構文
public static class クラス名{
some code
}
サンプルコード
using System;
namespace ProjectAbc
{
class DemoArk
{
static void Main()
{
Console.WriteLine(CftDemo.emp);
CftDemo.TestFunc();
}
}
public static class CftDemo
{
public static int emp = 666;
public static void TestFunc()
{
Console.WriteLine("777");
}
}
}
結果
666
777