weiß vielleicht jemand eine kürzere schreibweise zu diesem programm?
Edit Illu: Codetags :!:
Code:
public class h2u2 {
public static void drehen(int[] b) {
int erste = 0;
int letzte =b.length-1;
while (erste <letzte) {
int temp = b[letzte];
b[letzte]=b[erste];
b[erste] = temp;
erste++;
letzte--;
}
System.out.println("\nDrehen (a) = ");
for (int i=0; i<b.length;i++) {
System.out.print(b[i]+" ");
}
}
public static void main(String[] args) {
int[] a = {2, 4, 6, 7, 8, 9, 10, 11, 23, 99};
drehen(a);
}
}
Edit Illu: Codetags :!: