Array - insertion sort

The code is fine i guess but its showing me runguard error
i will share the error in next doubt post
import java.util.*;
public class Main {
public static void main(String args[]) {
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
//array declare
int [] A = new int [N];

	for(int i=0; i<=A.length-1;i++){
		A[i] = sc.nextInt();
	}
	insertion(A);
	display(A);
}
public static void insertion(int [] arr)
{
	int counter = 1;
	while(counter<=arr.length-1)
	{
		int val = arr[counter];
		int j = counter-1;
		while(j>=0 && arr[j] > val)
		{
			arr[j+1] = arr[j];
		}
		arr[j+1] = val;
		counter++;
	}
}
public static void display(int [] arr)
{
	for(int i=0; i<=arr.length-1;i++)
	{
		System.out.print(arr[i]+ "\t");
	}
}

}

@Naman_Gupta,
https://ide.codingblocks.com/s/252579 corrected code.

You didn’t add j-- in the inner while loop. Hence the infinite loop. Hence the error. Rest the code is correct. Also use a single space " " instead of “\t”.

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.