Skip to content
exKAZUu edited this page Mar 18, 2012 · 1 revision

People class

C#

public class People {
    public String Name { get; private set; }
    public int Age { get; private set; }
    public String Address { get; set; }

    public People(String name, int age) {
        Name = name;
        Age = age;
    }
}

Tane

type People
  Name : String
  Age : int
  public Address : String

// 以下3つはコンストラクタ
def People(Name, Age)
def People(Name, Age, Address)
def People(Name, bornTime : DateTime)
  Age = (DateTime.Now - bornTime).Year

Clone this wiki locally