Hi there,
I have 2 easy questions.
1. how do you add an integer into an array? I know how to add a text to an array (array.add("text")), but I dont know how to add an integer.
2. How to convert data type integer to datatype text.
Thanks!!!
Printable View
Hi there,
I have 2 easy questions.
1. how do you add an integer into an array? I know how to add a text to an array (array.add("text")), but I dont know how to add an integer.
2. How to convert data type integer to datatype text.
Thanks!!!
Arrays don't have methods, so you can't add anything to an array with array.add(). Arraylists on the other hand have methods, and you would add things to them with that method. Are you really using an arraylist instead of an array?
As for turning integers into strings, you use the Integer.toString(anInt) method.