Index out of bound exception

import java.util.Scanner;

public class ARRAY_DEMO {

public static void main(String[] args) {
	int[][] arr=takeinput();
	display(arr);

}
private static int[][] takeinput(){
	Scanner s=new Scanner(System.in);
	System.out.println("ENTER NO OF ROWS");
	int row=s.nextInt();
	int[][] arr=new int[row][];
	for(int rows=0;rows<row;rows++) {
	  System.out.println("ENTER NUMBER OF COLUMN");
	  int col=s.nextInt();
	  arr[row]=new int[col];
	  for(int cols=0;cols<col;col++) {
		  System.out.println("ENTER THE VALUE OF "+row+" "+col);
		  arr[row][col]=s.nextInt();
	  }
	}
	return arr;
}
private static void display(int[][]arr){
	for(int row=0;row<arr.length;row++) {
		 for(int cols=0;cols<arr[row].length;cols++) {
			 System.out.println(arr[row][cols]);
		 }
	}

}

@KUNAL.SHARMA5724510,
I have corrected your code: https://ide.codingblocks.com/s/205101
And I have commented the changes in the code itself.

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.