what are errors in my code--------
import java.util.*;
public class Main {
public static void main(String args[]) {
Scanner cin = new Scanner(System.in);
int n = cin.nextInt(),arr[] = new int[n];
for(int i = 0;i<arr.length;i++){
arr[i] = cin.nextInt();
}
selectionSort(arr);
for(int ar:arr){
System.out.println(ar);
}
}
public static void selectionSort(int []arr){
for(int i = 0;i<arr.length-1;i++){
int min = i;
for(int j = i+1;j<arr.length;i++){
if(arr[min]>arr[j]){
min = j;
}
}
int temp = arr[i];
arr[i] = arr[min];
arr[min] = temp;
}
}
}