Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Class implementation
#import <Foundation/Foundation.h> @interface Student:NSObject { int age; int rollno; NSString *name; } -(int) rollno; -(int) age; - (NSString*) name; @end @implementation Student -(id)init { self = [super init]; rollno = 10; name = @"Student Name"; age = 22; return self; } -(int) rollno { return rollno; } -(NSString*) name { return name; } -(int) getage { return age; } @end int main( ) { Student *s1 = [[Student alloc]init]; // Create student object int rollno,age; NSString *name; rollno = [s1 rollno]; name = [s1 name]; age = [s1 getage]; NSLog(@"Student Roll No : %d", rollno); NSLog(@"Student Age : %d", age); NSLog(@"Student Name : %@", name); return 0; }
run
|
edit
|
history
|
help
0
find maximum in objective c
BookAuther
Objective C Class and Object example
Book NSSet
string divison
bookinheritence
NSArray Method Exercise
objective c find factorial
add
NSMutableset(add/remove,Etraction,Intersect)