wesley 3 Report post Posted September 3, 2016 Hello, I have make a list. I want to show the content of the list. But this is not working. I do this with a for loop. Now I only see @ and numbers. can someone help me? thanks in advance my code is: public static void main(String[] args) { // TODO code application logic here ArrayList<list>items = new ArrayList<>(); items.add(new Draw("oval", 10, 15)); items.add(new Draw("polygon", 30, 28)); // let us print all the elements available in list // this is not working for (list number : items) { System.out.println(number); } } Share this post Link to post Share on other sites
davej 251 Report post Posted September 3, 2016 Where is this code from? What are you importing at the top of this file? Did you override the toString method in the Draw class? Do you also have a list class or is that a typo? Share this post Link to post Share on other sites