T
Tom Wouters
hi everone,
i am trying to write a function called shiftDown.
This function needs to move the contents of an array one place back .
ex. int[] intarray = new int[4]
intarray[0] = 1;
intarray[1] = 2;
intarray[2] = 3;
intarray[3] = 4;
then i want to use the function and i must have the following: intarray[0]
must then be 2
intarray[1] must be 3
intarray[2] must be 4
and intarray[3] must be 1
i am working on this for days now and still can't figure it out this is
what i allready have but it doesn't work
public void shiftDown() {
for (int i = 0; i < lengte2.length; i++) {
if ( lengte2 == lengte2.length) {
lengte2 = lengte2[0];
lengte2 = lengte2[i + 1];
}
}
}
lengte2 is my array.
TIA
Tommaz
i am trying to write a function called shiftDown.
This function needs to move the contents of an array one place back .
ex. int[] intarray = new int[4]
intarray[0] = 1;
intarray[1] = 2;
intarray[2] = 3;
intarray[3] = 4;
then i want to use the function and i must have the following: intarray[0]
must then be 2
intarray[1] must be 3
intarray[2] must be 4
and intarray[3] must be 1
i am working on this for days now and still can't figure it out this is
what i allready have but it doesn't work
public void shiftDown() {
for (int i = 0; i < lengte2.length; i++) {
if ( lengte2 == lengte2.length) {
lengte2 = lengte2[0];
lengte2 = lengte2[i + 1];
}
}
}
lengte2 is my array.
TIA
Tommaz