var my_array=["Dhoni","Sachin","Rohit","Dhawan"]; In this case we’re storing strings inside of the array, but we really could have used any data type we wanted. In the above application, we can print the values by converting our ArrayList object into the Array [ al.toArray()] also, but in the real time, there may be a chance to add some user defined class objects into the ArrayList, in that scenario obviously the better approach will be converting to Object type and then check the type caste and go ahead. ALL RIGHTS RESERVED. document.write(country[i] + "
"); country = "India"; document.write(emp[num] + "