Chinaunix首页 | 论坛 | 博客
  • 博客访问: 200639
  • 博文数量: 69
  • 博客积分: 1400
  • 博客等级: 上尉
  • 技术积分: 720
  • 用 户 组: 普通用户
  • 注册时间: 2005-08-03 11:35
文章分类

全部博文(69)

文章存档

2011年(13)

2010年(46)

2009年(10)

我的朋友

分类: Java

2010-07-14 09:45:40

JLS100714Note on JLS, Ch10

 

@ http://zcatt.cublog.cn

 

Hist:

1007014, draft

 

 

 

Chapter 10 Array(数组)

An array object contains a number of variables.These variables are called the components of the array. The components of the array are referenced using integer indices from 0 to n-1, inclusive.

All the components of an array have the same type, called the component type of the array. If the component type of an array is T, then the type of the array itself is written T[].

 

Array Types

An array type is written as the name of an element type followed by some number of empty pars of square brackets []. The number of bracket pairs indicateds the depth of array nesting.

 

Array Variables

An array is an object, and a variable of array type holds to a reference to the object.

 

Array Creation

It is a compile-time error if the element type is not a reifiable type

 

Array Access

 

Array Initializers

ArrayInitializer:

{ VariableInitializersopt ,opt }

 

VariableInitializers:

VariableInitializer

VariableInitializers , VariableInitializer

 

Array Members

1)      public finale field, length

2)      public method, clone. The return type of the clone method of an array type T[] is T[].

3)      all the members inherited from class Object, the only method of Object that is not inherited is its clone method.

A clone of a multidimentsional array is shallow.

 

Class Objects for Arrays

 

An Array of Characters is Not a String

A String object is immutable. The method toCharArray in class String returns an array of characters. The StringBuffer implements useful methods on mutable arrays of characters.

 

Array Store Exception

 

 

REF

1.       JLS 3nd

2.       JVM 2nd
Locations of visitors to this page

阅读(953) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~