1. to read the numbers use -
Scanner input = new Scanner (System.in);
int number = input.nextInt()
2. to swap a number u should make something like
int a = 0;
a = arr[i]
arr[i] = arr[i+1] // instead ot i u can put any number of element u want to switch
arr[i+1] = a
3. iam not very sure:
arr[i] = whatever value u want
4. i dont know