#import <Foundation/Foundation.h>
@interface Student : NSObject
@property (retain,nonatomic) NSString *name;
@property (assign,nonatomic)int age;
- (void) setAge: (int)newAge;
- (NSComparisonResult)myCompare: (id)anObject;
+ (Student *)studentWithName:(NSString *)n andAge:(int)a;
@end
#import "Student.h"
@implementation Student
@synthesize name,age;
+ (Student *)studentWithName:(NSString *)n andAge:(int)a{
Student *student = [[Student alloc] init];
student.name=n;
student.age=a;