상속 예제 썸네일형 리스트형 Objective C 상속 예제 따라하기 두번째 - 도형에 관한 상속 예제이다.- 소스코드#import @interface Rectangle : NSObject{ int width; int height; } @property int width, height; -(int)area; -(int)perimeter; -(void)setWidth:(int) w andHeight: (int) h; @end #import "Rectangle.h" @implementation Rectangle @synthesize width, height; -(int)area{ return width*height; } -(int)perimeter{ return (width+height)*2; } -(void)setWidth:(int) w andHeight: (int) h{ widt.. 더보기 이전 1 다음