- JavaStudy2004/클래스상속 . . . . 2 matches
예를 들어 Motorcycle클래스와 같이 Car라는 클래스를 만드는 것을 생각하자. Car와 Motorcycle은비슷한 특징들이 있다. 이 둘은 엔진에 의해 움직인다. 또 변속기와 전조등과 속도계를 가지고 있다. 일반적으로 생각하면, Object라는클래스 아래에 Vehicle이라는 클래스를 만들고 엔진이 없는 것과 있는 방식으로 PersonPoweredVehicle과 EnginePoweredVehicle 클래스를 만들 수 있다. 이 EnginePoweredVehicle 클래스는 Motorcycle, Car, Truck등등의 여러 클래스를 가질 수 있다. 그렇다면 make와 color라는 속성은 Vehicle 클래스에 둘 수 있다.
Found 1 matching page out of 7555 total pages (5000 pages are searched)
You can also click here to search title.