Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

how to get index of arraylist in java

List aList = new ArrayList();
aList.add("Orange");
aList.add("Apple");
aList.add("Peach");
aList.add("Guava");
aList.add("Mango");
System.out.println("The index of the element Apple in ArrayList is: " +
aList.indexOf("Apple"));
Source by www.tutorialspoint.com #
 
PREVIOUS NEXT
Tagged: #index #arraylist #java
ADD COMMENT
Topic
Name
5+9 =