Quick actions

cmd+k|ctrl+k

Navigation

Languages

Obtuse Java

Snippet info

Language

Java

Visibility

public

Author

doug

Created

2016-07-20T18:07:52Z

Updated

2016-07-20T18:11:09Z

import java.util.ArrayList;

class Main {
    public static void main(String[] args) {
        
        ArrayList<Game> games = new ArrayList<>();
        games.add(new Game(12));
        games.add(new Game(43));
        games.add(new Game(8));
        
        int total = games.stream().mapToInt(Scoreable::getScore).sum();
        
        System.out.println(total / games.size());
    }
}
INFO