.Net Project/.Net 3.5 Sp1

48장 Class(클래스)

래곤 2009. 8. 11. 13:22
반응형




using System;

public class 클래스
{
    //Entry Point
    public static void Main()
    {
        //Car 인스턴스 생성
        Car car = new Car();
        car.Run() ;
        car.Color = "Red";

        //Human 클래스 이용
        Human h = new Human();
        h.Name = "아우디";
        h.Age = "12세";
        h.show();

        //Static 클래스 이용
        StaticClass s = new StaticClass();
        StaticClass.Name = "Kim Yong Won";
        s.Age = 21;
    }
}

-------------------------------------------------------------
using System;

public class 클래스
{
    //Entry Point
    public static void Main()
    {
        //Car 인스턴스 생성
        Car car = new Car();
        car.Run() ;
        car.Color = "Red";

        //Human 클래스 이용
        Human h = new Human();
        h.Name = "아우디";
        h.Age = "12세";
        h.show();

        //Static 클래스 이용
        StaticClass s = new StaticClass();
        StaticClass.Name = "Kim Yong Won";
        s.Age = 21;
    }
}


반응형