iPhoneSDKlesson1-精品·公开课件.pptVIP

  • 0
  • 0
  • 约1.08万字
  • 约 50页
  • 2018-11-03 发布于广西
  • 举报
//Square.h #import Rectangle.h @interface Square: Rectangle -(Square*) initWithSize: (int) s; -(void) setSize: (int) s; -(int) size; @end //Square.m -(Square*) initWithSize: (int) s { self = [super init]; if ( self ) { [self setSize: s]; } return self; } -(void) setSize: (int) s { width = s; height = s; } -(int) size { return width; } -(void) setWidth: (int) w { [self setSize: w]; } -(void) setHeight: (int) h { [self setSize: h]; } @end //main.m #import Square.h #import Rectangle.h int main( int argc, const char *argv[] ) { Rectangle *rec

文档评论(0)

1亿VIP精品文档

相关文档