List list = new ArrayList();
String[] test = {"ram", "mohan", "anil", "mukesh", "mittal"};
for(int i =0; i < test.length; i++)
{
A a = new A();
a.setName(test[i]);
list.add(a);
}
How JVM handles creation of object a in each loop? How "list" differntiate between different instance? Is it good practice to create object on each iteration. If no, what is the best solution for adding object into a list.