About Question enthuware.ocpjp.v8.2.1108 :
Posted: Sun Sep 22, 2019 2:29 pm
Hello.
There is a minor typo in explanation of choice 1:
There is a minor typo in explanation of choice 1:
0*10 should be 0*111. It will always assign 0 to i because Math.random() returns a double between 0 and less than 1 and since casting operator i.e. (int) takes precedence to *, the double value returned by Math.random() will be converted to int first, which will make it 0. 0*10 will be 0. So, you should do: int r = (int) (Math.random()*11);