Question: ```
static final ArrayList<HashMap<String,String>> arraylistobject = new ArrayList<HashMap<String,String>>();
    private void populateList() {
        HashMap<String,String> temp = new HashMap<String,String>();
        temp.put("pen","MONT Blanc");
        temp.put("price", "200 rs");
        arraylistobject.add(temp);
        HashMap<String,String> temp1 = new HashMap<String,String>();
        temp1.put("pen","Gucci");
        temp1.put("price", "300 rs");
        arraylistobject.add(temp1);
        HashMap<String,String> temp2 = new HashMap<String,String>();
        temp2.put("pen","Parker");
        temp2.put("price", "400 rs");
        arraylistobject.add(temp2);
        HashMap<String,String> temp3 = new HashMap<String,String>();
        temp3.put("pen","Sailor");
        temp3.put("price", "500 rs");
        arraylistobject.add(temp3);
        HashMap<String,String> temp4 = new HashMap<String,String>();
        temp4.put("pen","Porsche Design");
        temp4.put("price", "600 rs");
        arraylistobject.add(temp4);

```

Answer: 
You can use a loop to create the HashMaps and add them to your List, but you still have to do something about those hard-coded String literals.

```
for(int i = 0; i < 150; i++) {
    HashMap<String,String> temp = new HashMap<String,String>();
    temp.put("pen", "MONT Blanc");
    temp.put("price", "200 rs");
    arraylistobject.add(temp);
}

```

You could read the values that you put in the `temp` map from a configuration file or a database to initialize the List, but that's a whole other issue.

You should also check out the [Java Tutorials: Collections](http://download.oracle.com/javase/tutorial/collections/index.html) articles.
A `List` is meant to grow, not have a pre-initialised size. So if you want 150 as the length, you should add 150 elements to the list. Otherwise, stick to arrays.