Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

java how to find the largest number in an arraylist

List<Integer> myList = new ArrayList<>();

for(int i = 0; i < 10; i++){
    myList.add(i);
}
//gets highest number in the list
int highestNumber = Collections.max(myList);

System.out.Println(highestNumber);

//output: 9
 
PREVIOUS NEXT
Tagged: #java #find #largest #number #arraylist
ADD COMMENT
Topic
Name
3+8 =