0 votes
in JAVA by (19.9k points)


int values[ ] = {1,2,3,4,5,6,7,8,9,10};  

for(int i=0;i< Y; ++i)  


Find the value of value[i]?

a) 10

b) 11

c) 15

d) None of the above

1 Answer

0 votes
by (19.9k points)

(d) None of the above

Reason: 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.

Related questions