SimpleCollection.java
2008-05-23 20:28
267 查看
public class SimpleCollection{
private Object[] objArr;
private int index=0;
public SimpleCollection(){
objArr=new object[10];
}
public SimpleCollection(int capacity){
objArr=new Object[capacity];
}
public void add(Object o){
objArr[index]=o;
index++;
}
public int getLength(){
return index;
}
public Object get(int i){
return objArr[i];
}
}
private Object[] objArr;
private int index=0;
public SimpleCollection(){
objArr=new object[10];
}
public SimpleCollection(int capacity){
objArr=new Object[capacity];
}
public void add(Object o){
objArr[index]=o;
index++;
}
public int getLength(){
return index;
}
public Object get(int i){
return objArr[i];
}
}
相关文章推荐
- SimpleCollectionDemo.java
- java_之数组(Collection--List)
- java日期 - SimpleDateFormat
- Java基础(集合卷)--单列集合老大Collection
- java持有对象collection
- Java基础(集合卷)--单列集合老大Collection
- Java基础--Collection方法
- Java基础--Collection方法
- java集合 之 Collection和Iterator接口
- java集合2——集合collection的一些练习题
- java容器类持有对象:Collection Map List Set Queue
- 简单选择排序算法(Simple Selection Sort) Java实现
- Java - Collection
- Java collection 的一些介绍 集合
- Java-Collection源码分析(三)——List和AbstractList
- Java实现简单的LRU缓存(A Simple LRU Cache in 5 lines)
- Java_Collection
- Java Simple Introduce
- java——深入java.util包(collection接口之AbstractList)
- java Date SimpleDateFormate日期时间格式 Calendar