how to store 2d array in 1d array in java code example Example: How to create a 2d array in java int[][] arr = new int[m][n];