Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

Implementing the Vector Class in java list

import java.util.*;

class Main {

    public static void main(String[] args) {
        // Creating list using the Vector class
        List<String> list = new Vector<>();

        // Add elements to the list
        list.add("Apple");  
        list.add("Mango");  
        list.add("Banana");  

        System.out.println("List: " + list);

        // Access element from the list
        String str = list.get(1);
        System.out.println("Accessed Element: " + str+"
");

        // Remove element from the list
        String removedstr = list.remove(1);
        System.out.println("Removed Element: " + removedstr);
    }
}
Comment

PREVIOUS NEXT
Code Example
Java :: date to yyMMdd conversion 
Java :: add close button on right top corner of alert dialog box for android 
Java :: calling java static method in kotlin 
Java :: How to make a Java Main Menu Loop after using a case 
Java :: euclidean algorithm java recursive 
Java :: How to perform an iterative inorder traversal through a binary search tree, in Java? 
Java :: jmeter set var jsr 
Java :: javac encoding utf-8 
Java :: no java virtual machine found after searching the following locations 
Java :: how to get app categories android packagemanager 
Java :: java change frame border 
Java :: java hashmap remove by condition 
Java :: java add element to map 
Java :: java set font 
Java :: javax.persistence.noresultexception: no entity found for query 
Java :: java clear scanner2 
Java :: creating jdbc connection in java using service name oracle 
Java :: how to call a static method in java 
Java :: map.keyset in java 
Java :: java wrapper classes 
Java :: command to create a Hashmap in Java 
Java :: random number 
Java :: get distinct values from list of objects java 
Java :: java delete element from list 
Java :: insertion sort java 
Java :: round to the next multiple of 5 
Java :: Java Change ArrayList Elements 
Java :: can abstract class have non abstract methods in java 
Java :: is it possible to declare two conditions in for loop in javascrip 
Java :: java long literal 
ADD CONTENT
Topic
Content
Source link
Name
9+4 =