Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

Java Finding Extreme Values

import java.util.Collections;
import java.util.ArrayList;
class Main {
    public static void main(String[] args) {
        // Creating an ArrayList
        ArrayList<Integer> numbers = new ArrayList<>();
        numbers.add(1);
        numbers.add(2);
        numbers.add(3);

        // Using min()
        int min = Collections.min(numbers);
        System.out.println("Minimum Element: " + min);

        // Using max()
        int max = Collections.max(numbers);
        System.out.println("Maximum Element: " + max);
    }
}
Comment

PREVIOUS NEXT
Code Example
Java :: Java Arraylist bestimmtes element ausgeben 
Java :: how to add value in jcombobox in java 
Java :: arraylistof objects 
Java :: how to find the size of table in java 
Java :: how to check android version 9 above programatically 
Java :: material motion android navigation arch 
Java :: springBoot Disable a Specific Auto-Configuration 
Java :: error attribute fabattached not found 
Java :: java 001 
Java :: spring boot rest api 
Java :: system.out.print 
Java :: system program j 
Java :: how to do 4th root java 
Java :: aws lambda upload file to s3 java 
Java :: Java Enable assertion in class names 
Java :: play default message ringtone android studio 
Java :: display pop up window overlay permission in redmi android studio 
Java :: android studio remove navigation bar 
Java :: java function 
Java :: java use of super keyword 
Java :: java indexof not found 
Java :: find power of number in method java 
Java :: java file path linux 
Java :: get the logged in user java 
Java :: java timer schedule every day 
Java :: ticket sales java program 
Sql :: delete all data in neo4j 
Sql :: sql find text in sp 
Sql :: mysql alter column default 
Sql :: restart the psql server windows 
ADD CONTENT
Topic
Content
Source link
Name
5+6 =