There are arrays and not list.
I didnt understand
Take a look here:
item = (get[index]);
Should we use like this.
Use like this:
String item = (String) list.get(INDEX);
Yess it can be!!
I have edited the code. See above
Is starts from 0 not 1
Anyone know how to fix this import in intelliij IDE??
it start from 1
I think lndex starts from 0 and position starts from 1? isnt it??
actually the index starts at 0, but the YailList AI index starts at 1, so the code above won't be able to retrieve data starting at index 0
YAILIST starts from 1 because there is already presence of a element in index 0. Am I right?
yeah you are right
I think this code starts from 1 because it belongs to the YailList class
Can you share the full screenshot
it will start at 0 I think
That's right.
Better will be to convert YailList into Array to avoid future misconceptions:
String[] arr = list.toStringArray();
String value = arr[index - 1]; //you take AI2 version of index but then convert that to Java's version