- //
- // main.m
- // OC05-task-04
http://www.kmnk01.com/hxpfk/2015/jq_1124/96.html - //
- // Created by Xin the Great on 15-1-26.
- // Copyright (c) 2015年 Xin the Great . All rights reserved.
- //
- #import <Foundation/Foundation.h>
- int main(int argc, const charchar * argv[]) {
- @autoreleasepool {
- // insert code here...
-
http://www.kmnk01.com/hxpfk/2015/jq_1124/97.html - //NSNumber//
- //封装基本数据类型
- int intValue = 100;
- float floatValue = 3.14;
- BOOL boolValue = YES;
- NSNumber *intNumber = [[NSNumber alloc] initWithInt:intValue];
- NSLog(@"intNumber is %@", intNumber);
- NSNumber *floatNumber = [NSNumber numbe
rWithFloat:floatValue];http://www.kmnk01.com/hxpfk/2015/jc_1124/98.html - NSLog(@"floatNumber is %@", floatNumber);
- NSNumber *boolNumber = [NSNumber numberWithBool:boolValue];
- NSLog(@"boolNumber is %@", boolNumber);
- //包装之后就可以放到容器中
- NSArray *arr = @[intNumber, floatNumber, boolNumber];
- NSLog(@"arr is %@", arr);
- //还原成基本数据类型
- float value = [floatNumber floatValue];
- int value2 = [intNumber intValue];
- NSLog(@"value is %.2f",value);
- NSLog(@"value2 is %d",value2);
- //快速创建的方法
- NSNumber *intNum = @80;//----> NSNumber *intNumber = [[NSNumber alloc] initWithInt:80];
-
http://www.kmnk01.com/hxpfk/2015/jc_1124/98.html - NSNumber *floatNum = @3.14;// ---->[NSNumber numberWithFloat:3.14];
-
http://www.kmnk01.com/hxpfk/2015/py_1124/103.html - NSNumber *boolNum = @YES;// ---> [NSNumber numberWithBool:YES];
-
http://www.kmnk01.com/hxpfk/2015/bt_1123/92.html - NSNumber *charNum = @'a'; // ---> [NSNumber numberWithChar:'a'];
- //运算
http://www.kmnk01.com/hxpfk/2015/jq_1124/102.html - NSNumber *number = @(1 + 2);
- //直接在数组中写
- NSArray *arr1 = @[@"string", @12, intNum, floatNum, boolNum, charNum, number];
- NSLog(@"arr1 is %@", arr1);
http://www.kmnk01.com/hxpfk/2015/jq_1124/100.html - }
- return 0;
- }
[Java语言] JDBC: 批量处理提高SQL处理速度
最新推荐文章于 2023-11-03 17:50:04 发布