All the posts and topics that contain only an error report will be moved here after the error is corrected. This is to ensure that when users view a question in ETS Viewer, the "Discuss" button will not indicate the presence of a discussion that adds no value to the question.
Hello.
There is a minor typo in explanation of choice 1:
1. 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);