The transformation of the relationship between the three, a picture clearly presented.
Code on:
One of the Maputils is Apache's collection package.
Package util;
Import java.util.ArrayList;
Import Java.util.Arrays;
Import Java.util.HashMap;
Import java.util.List;
Import Java.util.Map;
Import Org.apache.commons.collections.MapUtils;
public class Convert {public
static void Main (string[] args) {
//1. Array converted to List,map
string[] arr = {"123", "456" , "789", "123"};
list<string> list = arrays.aslist (arr);
Array to Map, one-dimensional array, the odd number is key, even for value, odd elements, the last drop
//. Two-D arrays as two one-dimensional arrays
map = Maputils.putall (new HashMap (), ARR);
string[][] ss = {{"A", "B", "E"},{"C", "D", "F"}};
Maputils.debugprint (SYSTEM.OUT,ARR,MAP);
Maputils.putall (map, arr);
Maputils.debugprint (SYSTEM.OUT,ARR,MAP);
Maputils.putall (map, ss);
Maputils.verboseprint (System.out,arr,maputils.invertmap (map));
List converts to arr
list<string> ls = new arraylist<string> ();
Ls.add ("WCh");
Ls.add ("name");
String[] as = (string[]) Ls.toarray ();
}
}