Jump to content

how show items from list?


wesley
 Share

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 comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...