Obtuse Java

Run Settings
LanguageJava
Language Version
Run Command
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()); } }
public interface Scoreable{ int getScore(); }
public class Game implements Scoreable{ private int score = 0; public Game(int score){ this.score = score; } public int getScore(){ return this.score; } }
Editor Settings
Theme
Key bindings
Full width
Lines