Java – How do I sort a random array position?


I have a random size array filled with random numbers (between 0 and 3). I have to sort a position in it. From this position, select the numbers "above" and "below" the selected position and save them in another array to make a copy. I did, but I do not know exactly how to select the "cut".

    public static void main (String[] args) {

// (1) creates the array "a" and fills it with a sequence of random numbers

Random generator = new Random (); // size of the vector with the positions of the agent
Random numbers = new random numbers (); // instructions for the agent
Random rnd = new Random (); // vector intersection position

int aux = generator.nextInt (11);
int [] a = new int[aux];
int [] v = new int[aux];



for (int i = 0; i <a.length; i ++) {
to[i]= Numbers.nextInt (4);
System.out.println ("a[" + i + "]= "+ a[i]);
}
System.out.println ();

// (2) Copy the content from "a" to "b" using the for loop

int [] b = new int[a.length]; // First, space must be reserved for b
for (int i = 0; i <a.length; i ++) b[i]a[i]; // Now we can copy


// (3) displays the contents of "b"
for (int i = 0; i <a.length; i ++) {
System.out.println ("b[" + i + "]= "+ b[i]);
int j = 0; / *
v[j]= numbers.nextInt (b.length);
}
System.out.println (v); * /


int x = 0;
int [] s = new int[x];
x = rnd.nextInt (i);
s[j] = x;

System.out.println (s);
}

PS this is for a work of genetic algorithms so visualizes the vector as an agent and after the cut i have to cross with another vector like msm but with different positions if they do not get something they can ask obg already