Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.23 KB | None | 0 0
  1. // 名前空間BGST
  2. namespace BGST
  3. {
  4.  
  5. // テストクラス
  6. public class TestClass // TestClassの定義
  7. {
  8.  
  9. // フィールド
  10. public int testField; // int型のフィールドtestField.
  11.  
  12. // プロパティ
  13. private int testPropertyNum; // int型のフィールドtestPropertyNum.
  14. public int TestPropertyNum // int型のプロパティTestPropertyNum.
  15. {
  16.  
  17. // 取得
  18. get
  19. {
  20. // testPropertyNumを返す.
  21. return testPropertyNum; // returnでtestPropertyNumを返す.
  22. }
  23.  
  24. // 設定
  25. set
  26. {
  27. // testPropertyNumに格納.
  28. testPropertyNum = value; // valueをtestPropertyNumに格納.
  29. }
  30.  
  31. }
  32.  
  33. // コンストラクタ
  34. public TestClass() // コンストラクタTestClass.
  35. {
  36.  
  37. // メンバの初期化.
  38. testField = 10; // testFieldを10で初期化.
  39.  
  40. }
  41.  
  42. // メソッド
  43. public int GetTestField() // testFieldを返すGetTestField.
  44. {
  45.  
  46. // testFieldを返す.
  47. return testField; // returnでtestFieldを返す.
  48.  
  49. }
  50.  
  51. }
  52.  
  53. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement