Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

get list data in java

import java.util.*;
  
public class GFG {
    public static void main(String[] args)
    {
        // creating an Empty Integer List
        List<Integer> arr = new ArrayList<Integer>(4);
  
        // using add() to initialize values
        // [10, 20, 30, 40]
        arr.add(10);
        arr.add(20);
        arr.add(30);
        arr.add(40);
  
        System.out.println("List: " + arr);
  
        // element at index 2
        int element = arr.get(2);
  
        System.out.println("The element at index 2 is " + element);
    }
}
Comment

PREVIOUS NEXT
Code Example
Java :: how to stop activity from another activity 
Java :: difference between class and interface 
Java :: Convert Strings To Mathematical Expressions In java 
Java :: remove duplicate from string 
Java :: word count in a string using HashMap Collection 
Java :: How to check if a string is in alphabetical order in java 
Java :: java 2 decimals 
Java :: how to put string in char array in java tutorialspoint 
Java :: what is var in java 
Java :: how to unistall java 
Java :: float java 
Java :: enum values to string array 
Java :: java pattern check 
Java :: how to change the character of a string in java 
Java :: save bitmap file for share on android 10 
Java :: convert calendar to date java 
Java :: set jcombobox index java 
Java :: how to find sum of the digit of the numbers in java 
Java :: how to plus two numbers in java 
Java :: remove empty elements from array java 
Java :: binary to decimal java 
Java :: get all enum values java 
Java :: how to get cpu model number in android programmatically 
Java :: how to find armstrong numbers in java 
Java :: and roid shape setCornerRadii 
Java :: java array of array 
Java :: javafx edit list 
Java :: java android build secret keys 
Java :: example of HashSet 
Java :: Exception in thread "main" java.lang.NoClassDefFoundError sdkmanager 
ADD CONTENT
Topic
Content
Source link
Name
1+8 =