Possible Duplicate:
Java: How to convert List to Map
I have arrayList
ArrayList<Product> productList = new ArrayList<Product>();
productList = getProducts(); //Fetch the result from db
I want to convert to ArrayList to HashMap Like this
HashMap<String, Product> s= new HashMap<String,Product>();
Please help me how to convert to HashMap.