New to Java. I am trying to display the contents of my ArrayList. In the ArrayList are objects based off the Class PalletLocations. If I loop through the ArrayList I just get the object name/location (not sure what it is). For example "wms.PalletLocations@30fc1f".
ArrayList<PalletLocations> palletLocList = new ArrayList<PalletLocations>();
PalletLocations palLoc = new PalletLocations();
palLoc.addPalletLocation(palletText.getText(), rsPallets.getString("LOCATION"),rsPallets.getLong("QTY"), rsPallets.getString("ITEM_NO"));
palletLocList.add(palLoc);
for (int i = 0; i < palletLocList.size(); i++) {
System.out.println(palletLocList.get(i));
}
public class PalletLocations {
public static String palletNbr;
public static String location;
public static long qty;
public static String itemNbr;
public void addPalletLocation(String sPalletNbr, String sLocation, long lQty, String sItemNbr) {
palletNbr = sPalletNbr;
location = sLocation;
qty = lQty;
itemNbr = sItemNbr;
}
}
Thanks for the help.