The method to determine whether an array is empty in java is as follows:
One-dimensional array
// 一维数组: int[] array if(array == null || array.length == 0) return true;
Two-dimensional Array
//二维数组: int[][] array if((array==null||array.length==0)||(array.length==1&&array[0].length==0)) return true;
Method introduction:
java basic tutorial.
The above is the detailed content of How to determine whether an array is empty in java?. For more information, please follow other related articles on the PHP Chinese website!