单选题

阅读下面代码: @interface Parent : NSObject...

发布于 2022-03-03 11:11:12

阅读下面代码:

@interface Parent : NSObject
@property(nonatomic,assign)int age
@end
@implementation Parent
@dynamic age
@end
@interface Child : Parent
@end
@implementation Child
@synthesize age = _age
@end

请问以下代码的输出是:()

Parent *parent = [Parent new]
parent.age = 30
NSLog(@"parent age: %d", parent.age)
Child *child = [Child new]
child.age = 8
NSLog(@"child age: %d", child.age)


登录后免费查看答案
关注者
0
被浏览
8
知识点
面圈网VIP题库

面圈网VIP题库全新上线,海量真题题库资源。 90大类考试,超10万份考试真题开放下载啦

去下载看看