Why This Extension is not Compiling?

There are arrays and not list.

I didnt understand :thinking:

1 Like

Take a look here:

1 Like
item = (get[index]);

Should we use like this.

Use like this:

String item = (String) list.get(INDEX);
1 Like

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??
image

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
1 Like

@oseamiya Is your Problem fixed now ???