private static Map<String, ArrayList<String>> loadValues = new HashMap<String,ArrayList<String>>();
static ArrayList details = new ArrayList<String>();
我输入2组值... say .. key:1值:abc,[email protected],555和key:2值:xyz,x @ z .com,765ArrrayList在检索键值的Hashmap中
我试过了。
System.out.println("Enter the User ID:");
userID = in.next();
System.out.println("Enter your name:");
name = in.next();
details.add(name);
System.out.println("Enter your e-mail:");
email = in.next();
details.add(email);
System.out.println("Enter your contact number:");
contactNo = in.next();
details.add(contactNo);
loadValues.put(userID, details);
和使用迭代器打印... 当我尝试打印,其打印像...
1: abc, [email protected], 555 ,xyz,[email protected],765
2: abc, [email protected], 555 ,xyz,[email protected],765
但是,我需要打印,1: abc, [email protected], 555 and 2: xyz,[email protected],765
我应该怎么办?
您能否提供您用于打印值的代码? – Smallhacker 2013-05-10 11:01:21