list size in java
Collection<Object> list = new ArrayList<>();
list.size();
// All collections use size()
// array use array. length
list size in java
Collection<Object> list = new ArrayList<>();
list.size();
// All collections use size()
// array use array. length
how to get a list length in java
import java.util.ArrayList;
import java.util.List;
public class Demo {
public static void main(String[] args) {
List aList = new ArrayList();
aList.add("Apple");
aList.add("Mango");
aList.add("Guava");
aList.add("Orange");
aList.add("Peach");
System.out.println("The size of the ArrayList is: " + aList.size());
}
}
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