如果自己写了一个类对其调用时不理解其调用用法以及原理。可以与JDK类库里的类比较一下就会明白。
例如: 自己写了一个Student类怎样调用它? 我们可以把它与String类比较
String类生命与调用:
String str = new String( ) ;
相对于数组 :
String[ ] strs = new String[ 7 ] ;
存入数组:
strs[ 0 ] = str ;
那么 , Student 类:
Student stu = new Student( ) ;
相对于数组 :
Student[ ] stus = new Student[ 7 ] ;
存入数组:
stus[0] = stu ; ( 重点理解 )