Map<Integer, String> map = new HashMap<Integer, String>() {{
put( 1 , "name" );
put( 2 , "sex" );
}};
List<String> list = new ArrayList<String>() {{
add( "first" );
add( "second" );
add( "third" );
}};
http://blog.csdn.net/subuser/article/details/21105141