Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Integer[] to a String while setting a text field  RSS feed

 
Chadd Franck
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could someone tell me what is wrong?

assuming allStatsArray2 is an Integer[].

I keep getting null values I think.

I did a workaround like this

and it works what am I missing?
 
Campbell Ritchie
Sheriff
Posts: 53749
127
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please supply more details. What happens? What happens when you simply print out the array (System.out.println(allStatsArray2) ?
 
Chadd Franck
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, unfortunately I changed all the code before I posted so I will have to take some time to rewrite a sampleClass to post. I just read the faq on how to post, will will give some more effort before I repost.
 
Rob Spoor
Sheriff
Posts: 20893
81
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Chadd Franck:
Could someone tell me what is wrong?

assuming allStatsArray2 is an Integer[].

Have you also initialized each element of the array? "new Integer[X]" creates a new array object alright, but all of its elements remain null (or false for boolean, 0 for numbers, \u0000 for char). You need to initialize each one separately.
 
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!