java create empty arraylist
ArrayList<Class> myList = new ArrayList<Class>();
java create empty arraylist
ArrayList<Class> myList = new ArrayList<Class>();
ArrayList isEmpty() method in java
import java.util.ArrayList;
public class ArrayListIsEmptyMethodExample
{
public static void main(String[] args)
{
ArrayList<Integer> al = new ArrayList<Integer>();
// before checking ArrayList using isEmpty() method
System.out.println("Is ArrayList empty: " + al.isEmpty());
al.add(86);
al.add(25);
al.add(53);
al.add(85);
// after checking ArrayList using isEmpty() method
System.out.println("Is ArrayList empty: " + al.isEmpty());
for(Integer num : al)
{
System.out.println(num);
}
}
}
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