J’explorais la source Java 8 et j’ai trouvé cette partie du code très surprenante: //defined in IntPipeline.java @Override public final OptionalInt reduce(IntBinaryOperator op) { return evaluate(ReduceOps.makeInt(op)); } @Override public final OptionalInt max() { return reduce(Math::max); //this is the gotcha line } //defined in Math.java public static int max(int a, int b) { return (a >= […]
Pour un défi, un autre joueur de code a écrit le code suivant : import java.util.*; public class Main { public static void main(Ssortingng[] args) { int size = 3; Ssortingng[] array = new Ssortingng[size]; Arrays.fill(array, “”); for(int i = 0; i <= 100; ) { array[i++%size] += i + " "; } for(String element: […]