C#'

C# 클래스

왕왕왕왕 2015. 11. 6. 13:30

class Point

{

public int x;

public int y;

public Point() // 생성자함수

{

x = 0;

y = 0;
}

}

 

 

class Program

{

static void Main()

{

Point pt = new Point();

System.Console.WriteLine("({0}, {1})", pt.x, pt.y);

 

pt.x = 10;

pt.y = 20;

System.Console.WriteLine("({0}, {1})", pt.x, pt.y);

}

}