+ 1

Arrays: Using charAt() with Integers (something like intAt())

Heyya! ^^ I need something like intAt() in an array. int[] array; for(int x = 0; x<array.length(); x++) { int currentValue = array.intAt(x); } That is something I would like to achieve ^^

8th Jan 2019, 5:17 PM
Gino ^^
Gino ^^ - avatar
5 Réponses
+ 2
In arrays you don't need any intAt() or charAt() functios. You can simply use int currentValue = array[x]; to get element of the array at x index. However note, you did not initialize your array and put values in it so you will get error.
8th Jan 2019, 5:41 PM
Asirap
+ 1
Thanks guys :) yeah I shortened down the code. It is initialised in my project ^^
8th Jan 2019, 8:39 PM
Gino ^^
Gino ^^ - avatar
+ 1
that will give error
8th Jan 2019, 10:18 PM
Ayebidun Ezekiel Oluwaseyi
Ayebidun Ezekiel Oluwaseyi - avatar
0
This could help but maybe u should learn to initialise arrays first
8th Jan 2019, 7:02 PM
Yash
Yash - avatar