-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAssignment114_.java
More file actions
47 lines (31 loc) · 983 Bytes
/
Assignment114_.java
File metadata and controls
47 lines (31 loc) · 983 Bytes
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
package abhilash_Asignments;
import java.util.Vector;
/*"WAP on Vector methods
addElements();
firstElement();
lastElement();
removeElement();
removeElementAt();
removeAllElements()
capacity();"
*/
public class Assignment114_ {
public static void main(String[] args) {
Vector V1 = new Vector ();
V1.addElement("Abhilash");
V1.addElement("Ramesh");
V1.addElement("Rajesh");
V1.addElement("Vamshi");
V1.addElement("Manish");
Object First = V1.firstElement();
System.out.println("First Elements :- " + First);
Object Last = V1.lastElement();
System.out.println("Last Elements : " + Last);
V1.removeElement("Rajesh");
System.out.println("After Removed specfic Elements:- " + V1);
V1.removeAllElements();
System.out.println("Removing all the Elements : " + V1);
V1.capacity();
System.out.println("Capacity :- " + V1.capacity());
}
}