Im working on a java project for a class which has a user enter a zip code, and the information (city, state..ect) that goes along with the zip code is returned to the user.
All the zip codes are stored in an arraylist which stores each zip code and its information in an object.
This is the code used to add zip code object to the array list:
ZipCode zip = new Zipcode(zipcode, city, state, lat, lon); zipCode.add(zip);
My my question is how do i get certain information out of the arraylist from each object?
For example if i wanted to use the
getZip() method to return the zipcode of the zipCode object in spot 39 how would that be done?
I hope I havent been to confusing.