P
plz help
Gast
Code:
public static String ou(){
p= new String[o];
for (int l=0 ; l<k.anzahl; l++)
{
o=k.anzahl;
p[o]=k.x[l] +" "+ k.y[l];
}
return p[o];
}
Hallo versuche gerade n array zum funzen zu brignen das mir 5 (k.anzahl=5) mal die zeile k.x[l] +" "+ k.y[l] runterschreibt das ergenis soll so aussehen
422 423
233 242
231 243
245 253
223 423
k.x[array] für viele k.x werte von 0 bis 5 z.b.
aber ich will ja alle werte die die for-schleife für k.x[l] +" "+ k.y[l] berechnet als string untereinander formatiert in eine varibale namens p schreiben aber er gibt mir immer eine fehlermedlung aus :
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 5
at k.ou(k.java:75)
at k.main(k.java:15)
oben steht ausßerdem
Code:
public class k{
static int x[],y[],anzahl,o=0;
static String p[];