Given, int values[ ] = {1,2,3,4,5,6,7,8,9,10}; for(int i=0;i< Y; ++i) System.out.println(values[i]); Find the value of value[i]?
MCQExplainer
Check your spam folder if password reset mail not showing in inbox????
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
10 11 15 None of the above Answer: (d) None of the above Explanation: In the above code, we have not defined the variable Y. The code will not execute without any specific value for Y; it results in exception, as shown below. Exception in thread "main" java.lang.Error: Unresolved compilation problemRead more
Answer: (d) None of the above
Explanation: In the above code, we have not defined the variable Y. The code will not execute without any specific value for Y; it results in exception, as shown below.
Exception in thread “main” java.lang.Error: Unresolved compilation problem:
Y cannot be resolved to a variable
So, the values of i will not be printed, and the above exception is thrown.
Hence, the correct answer is (d).
See less