import java.util.*;
import java.lang.*;
import java.io.*;
import java.util.ArrayList;
import java.util.AbstractMap.SimpleEntry;

// The main method must be in a class named "Main".
class Main {
    public static void main(String[] args) {
        ArrayList<SimpleEntry<Integer,String>> listofentries=new ArrayList<>();
        listofentries.add(new SimpleEntry<>(1,"One"));
        listofentries.add(new SimpleEntry<>(2,"Two"));
        listofentries.add(new SimpleEntry<>(3,"Three"));

        for(SimpleEntry<Integer,String>entry:listofentries)
            {
                System.out.println(entry.getKey()+" "+entry.getValue());
            }
        System.out.println(listofentries.get(1));
    }
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: