isempty for arrays
arr = new int[0];
if (arr.length == 0) {
System.out.println("array is empty");
}
isempty for arrays
arr = new int[0];
if (arr.length == 0) {
System.out.println("array is empty");
}
isempty for arrays
Object arr[] = new Object[10];
boolean empty = true;
for (Object ob : arr) {
if (ob != null) {
empty = false;
break;
}
}
isempty for arrays
Object arr[] = new Object[10];
boolean empty = true;
for (int i=0; i<arr.length; i++) {
if (arr[i] != null) {
empty = false;
break;
}
}
isempty for arrays
int arr[] = null;
if (arr == null) {
System.out.println("array is null");
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us