1)数组
//一维数组的声明方式,声明数组时不能指定其长度(数组中元素的个数)
final int nLen = 8;
char []strInterview;
char strLocation[];
//Java中使用关键字new创建数组对象,格式为:
//数组名 = new 数组元素的类型 [数组元素的个数]
strInterview = new char[nLen];
strLocation = new char[nLen];
int i=0;
for(i=0; i<nLen; i++){
strInterview[i] = (char)('a'+ i);
strLocation[i] = (char)('i' + i);
}
System.out.println(strInterview);
System.out.println(strLocation);
2)String类
Java String 类小结(注:主要讲解API使用)
http://wuyang.blog.51cto.com/224534/45023
java String类详解(注:偏重原理性,讲解String池字符对象、堆字符对象、以及各种方法构造String 对象的差异、其背后隐藏的操作)
http://blog.csdn.net/qibinzhi/article/details/4814992
Java基础篇 对于String类型的深刻理解(注:偏重原理,更深更广)
http://tech.ccidnet.com/art/3539/20070523/1087805_1.html
//一维数组的声明方式,声明数组时不能指定其长度(数组中元素的个数)
final int nLen = 8;
char []strInterview;
char strLocation[];
//Java中使用关键字new创建数组对象,格式为:
//数组名 = new 数组元素的类型 [数组元素的个数]
strInterview = new char[nLen];
strLocation = new char[nLen];
int i=0;
for(i=0; i<nLen; i++){
strInterview[i] = (char)('a'+ i);
strLocation[i] = (char)('i' + i);
}
System.out.println(strInterview);
System.out.println(strLocation);
2)String类
Java String 类小结(注:主要讲解API使用)
http://wuyang.blog.51cto.com/224534/45023
java String类详解(注:偏重原理性,讲解String池字符对象、堆字符对象、以及各种方法构造String 对象的差异、其背后隐藏的操作)
http://blog.csdn.net/qibinzhi/article/details/4814992
Java基础篇 对于String类型的深刻理解(注:偏重原理,更深更广)
http://tech.ccidnet.com/art/3539/20070523/1087805_1.html