Array

Support for the latest build of L2J Server, get help here with installations, upgrades, problems.
Do not post bugs reports here, use viewforum.php?f=77 instead.
There is no support for other server builds than the official provided by l2jserver.com
Forum rules
READ NOW: L2j Forums Rules of Conduct
Post Reply
laikeriz
Posts: 48
Joined: Sun Feb 01, 2009 8:35 pm

Array

Post 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?
_DS_
L2j Veteran
L2j Veteran
Posts: 3437
Joined: Wed Apr 30, 2008 8:53 am
Location: Russia

Re: Array

Post by _DS_ »

Why you use int for String ?
Commiter of the shit
public static final int PI = 3.1415926535897932384626433832795;
laikeriz
Posts: 48
Joined: Sun Feb 01, 2009 8:35 pm

Re: Array

Post by laikeriz »

Well I don't know what to do else. It's the first time I'm using arrays.
_DS_
L2j Veteran
L2j Veteran
Posts: 3437
Joined: Wed Apr 30, 2008 8:53 am
Location: Russia

Re: Array

Post by _DS_ »

Use String, not int for array definition.
Commiter of the shit
public static final int PI = 3.1415926535897932384626433832795;
Probe
Posts: 915
Joined: Thu Sep 03, 2009 6:36 pm
Location: Israel
Contact:

Re: Array

Post by Probe »

String[] array = new String[10];
Post Reply