program 14B
This commit is contained in:
BIN
Screenshots/program14B.png
Normal file
BIN
Screenshots/program14B.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 11 KiB |
13
VectorDemo.java
Normal file
13
VectorDemo.java
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
// 14B
|
||||||
|
import java.util.Vector;
|
||||||
|
public class VectorDemo{
|
||||||
|
public static void main(String[] args){
|
||||||
|
Vector<String> vector = new Vector<>();
|
||||||
|
vector.add("Item X");
|
||||||
|
vector.add("Item Y");
|
||||||
|
vector.add("Item Z");
|
||||||
|
System.out.println("Elements at index 0: " + vector.get(0));
|
||||||
|
System.out.println("Elements at index 1: " + vector.get(1));
|
||||||
|
System.out.println("Elements at index 2: " + vector.get(2));
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user