About Question enthuware.ocpjp.v8.2.2024 :
Posted: Sat Dec 07, 2019 7:37 am
DoubleStream is = DoubleStream.of(0, 2, 4); //1
double sum = is.filter( i->i%2 != 0 ).sum(); //2
System.out.println(sum); //3
Why doesn't this give an ArithmeticException when the modulus operation tries to divide 0 by 2?
double sum = is.filter( i->i%2 != 0 ).sum(); //2
System.out.println(sum); //3
Why doesn't this give an ArithmeticException when the modulus operation tries to divide 0 by 2?