Counting sort problem

What is error 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();
}
int max = 0;
for(int i = 0;i<arr.length;i++){
if(max < arr[i]){
max = arr[i];
}
}
CountSort(arr,arr.length,max);
for(int ar : arr){
System.out.print(ar);
}
}
public static void CountSort(int [] arr,int n, int max){
n = arr.length;
int count[] = new int[max+1];
for(int i = 0;i<arr.length;i++){
++count[arr[i]];
}
for(int i = 1; i<=max; i++){
count[i] = count[i] + count[i+1];
}
int b[] = new int[n];
for(int i = n-1;i>-1;i++){
b[–count[arr[i]]] = arr[i];
}
for(int i =0;i<arr.length;i++){
arr[i] = b[i];
}
}
}

Hi ,
There were some errors i have corrected them . Look for the comments in the following code.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.