Quick actions

cmd+k|ctrl+k

Navigation

Languages

Max value java streams

Snippet info

Language

Java

Visibility

public

Author

mmuthuprasad

Created

2024-02-04T04:54:04.835069Z

Updated

2024-02-04T04:54:04.835069Z

import java.util.*;
class Main {
    public static void main(String[] args) {
        System.out.println("Hello World!");
        List<Integer> list = new ArrayList<>(Arrays.asList(23,55,77,99));
        int max = list.stream().mapToInt(Integer::intValue).max().orElseThrow();
        System.out.println(max);
    }
}
INFO