This method will convert data type Array to Map in key value pair.
1 2 3 4 | String[][] countries = { { "United States" , "New York" }, { "United Kingdom" , "London" }, { "Netherland" , "Amsterdam" }, { "Japan" , "Tokyo" }, { "France" , "Paris" } }; Map countryCapitals = ArrayUtils.toMap(countries); |