why im having runtym error in this code
package func;
import java.util.Scanner;
public class BubbleSort {
public static void bubble(int arr[])
{
for(int i=0;i<arr.length;i++)
{
for(int j=0;j<arr.length-i;j++)
{
if(arr[j]>arr[j+1])
{
int temp=arr[j];
arr[j]=arr[j+1];
arr[j+1]=temp;
}
}
}
}
public static void printArray(int arr[])
{
int n = arr.length;
for (int i=0; i<n; ++i)
System.out.print(arr[i] + " ");
System.out.println();
}
public static void main(String[] args) {
Scanner s=new Scanner(System.in);
int n=s.nextInt();
int[] arr=new int[n];
for(int i=0;i<n;i++)
{
//arr[i]=s.nextInt();
}
bubble(arr);
printArray(arr);
}
// TODO Auto-generated method stub
}