• Post Reply Bookmark Topic Watch Topic
  • New Topic

Printing an ArrayList object as a string  RSS feed

 
Marixa Garcia
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
At least, that's what I think I am trying to do. I'm not certain. I'm going to have trouble explaining this I think.

I start out with an ArrayList which is populated by the user inputting numbers.
The ArrayList is created like this:


After a loop, the myArray is populated by the user typing in numbers. Then I am subtracting two of the entered numbers.

difference is a double.

I want to print out with printf difference as a dollar figure like 100000 formatted to two decimal places.

I am brand new to ArrayLists so I'm not sure what's going on. My understanding is that it contains objects.

I assume that I am going about this all wrong. Any guidance would be appreciated.
 
Marixa Garcia
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Never mind. I didin't know what I was talking about. I do now. Thanks anyway.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!