|
Hey guys.
I'm currently working with Lists in a feature I'm adding in my server. I have a certain list, and I'm trying to use the in-built List function List.get(index).
For those unfamiliar, if I had a list:
List Animals = ["dog", "cat", "horse", "cow"];
Animals.get(1) should return "cat" because it is at position 1.
Now when I try to use this, I get a compiling error:
client.java:119: incompatible types
found: java.lang.Object
requires: java.lang.String
String score = List1.get(1);
^
I understand it's telling me that the 1 needs to be a string, however the method requires a int and I know that for a fact. I even replaced the 1 with the String "1" like it asks. But it gives me an error saying it needs to be an int.
All help is appreciated.
Thank you
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |