-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathVector_array.java
More file actions
52 lines (41 loc) · 1.37 KB
/
Vector_array.java
File metadata and controls
52 lines (41 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import java.util.Vector;
public class Vector_array {
public static void main(String[] args){
// Vector<Integer> a = new Vector<Integer>(10);
// for(int i=0; i<10; i++){
// a.add(i);
// }
// System.out.println(a);
// System.out.println("Capacity = "+a.capacity());
// System.out.println("Capacity = "+a.capacity());
// a.add(11);
// if(a.add(1000)){
// System.out.println("1000 added Successfully!");
// }
// // a.removeAllElements();
// // a.clear();
// if(a.isEmpty()){
// System.out.println("Vector is Empty!");
// }
// a.add(200);
// if(a.contains(200)){
// System.out.println("Vector contains 200!");
// }
// else{
// System.out.println("not contain 200!");
// }
// System.out.println(a);
// System.out.println(a.get(10));
// // System.out.println(a.set(10,11111));
// a.setElementAt(111111,10);
// System.out.println(a);
// System.out.println(a.indexOf(111111));
// a.clear();
Vector<Character> a = new Vector<Character>();
for(Character i=0; i<200;i++){
a.add(i);
}
System.out.println(a.size());
System.out.println(a);
}
}