728x90
반응형
import java.util.Vector;
class MyInt {
private int value;
MyInt(int i) {
this.value = i;
}
int getValue() {
return value;
}
}
public class Main {
public static void main(String[] args) {
Vector<MyInt> iv=new Vector<MyInt>();
for(int i=0; i<1000000; i++) {
iv.add(new MyInt(i));
}
for(int i=0; i<iv.size(); i++) {
MyInt mi = iv.get(i);
if(i%1000==0)
System.out.println(mi.getValue());
}
// System.out.println(100000000/60/60/24/365);
}
}
...
...
...
728x90
반응형
'즐거운프로그래밍' 카테고리의 다른 글
[자바] 추상 클래스(abstract), 밴딩머신 예제 (0) | 2023.10.23 |
---|---|
[자바] 겹치지 않는 랜덤 숫자 뽑아내기(Random) (0) | 2023.10.23 |
[자바] 인터페이스의 구현(interface) (1) | 2023.10.23 |
[자바] Vector 클래스 (0) | 2023.10.17 |
[자바] extends 문 활용한 예제 (Game) (1) | 2023.10.17 |