Jump to content

how show items from list?


Recommended Posts

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);
   }  

}
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...