For this Question: Implement Selection Sort on a given array, and make it sorted.First line of the input contains an integer, N, which denotes the length of the array. Next N inputs are elements of the array that is to be sorted in ascending order. 

Constraints
1<=N<=1000
-10000<=Arr[i]<=10000Sorted output where each element is space separatedSample Input:
3
3 1 2

Sample Output:
1 2 3, I have written this Solution Code: import java.io.*;
import java.util.*;



class Main {
	public static void main (String[] args) throws IOException{
         BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		 int n = Integer.parseInt(br.readLine());
		 String[] str = br.readLine().split(" ");
		 int a[] = new int[n];
		 for(int i=0; i<n; i++){
			 a[i] = Integer.parseInt(str[i]);
		 }

		 for(int i=0; i<n-1; i++){
			 for(int j=i+1; j<n; j++){
				 if(a[i]>a[j]){
					 int temp = a[i];
					 a[i] = a[j];
					 a[j] = temp;
				 }
			 }
		 }

		 for(int i=0; i<n; i++){
			 System.out.print(a[i]+" ");
		 }
	}
}, In this Programming Language: Java, Now tell me if this Code is compilable or not?