Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import java.util.Map;
import org.apache.commons.lang.ArrayUtils;

public class Main {

    public static void main(String[] args) {
        String[][] countries = { { "United States", "New York" }, { "United Kingdom", "London" },
                { "Netherland", "Amsterdam" }, { "Japan", "Tokyo" }, { "France", "Paris" } };

        Map countryCapitals = ArrayUtils.toMap(countries);

        System.out.println("Capital of Japan is " + countryCapitals.get("Japan"));
        System.out.println("Capital of France is " + countryCapitals.get("France"));
    }
}