Page 1 of 1

Array

Posted: Sun Oct 04, 2009 10:57 am
by laikeriz
If you want to receive support we need this info to help you properly.
» Find Revision
L2J Revision 3506:
L2JDP Revision 6606:
Hello. I'm trying to make an array which would contain strings and i could get them by number:

Code: Select all

 int _topPvpN[] = new String[10];...._topPvpN[1] = "aaa";....public int getTopPvpN(int i){return _topPvpN[i];} 
And the getTopPvpN(1); anwser would be "aaa". But it doesn't compile. I get errors. Anybody knows solution?

Re: Array

Posted: Sun Oct 04, 2009 11:09 am
by _DS_
Why you use int for String ?

Re: Array

Posted: Sun Oct 04, 2009 11:14 am
by laikeriz
Well I don't know what to do else. It's the first time I'm using arrays.

Re: Array

Posted: Sun Oct 04, 2009 11:38 am
by _DS_
Use String, not int for array definition.

Re: Array

Posted: Sun Oct 04, 2009 12:28 pm
by Probe
String[] array = new String[10];