public class Test{
public static void main(String args[]) {
try
int x = 0;
for (x=1; x<4; X++) ;
System.out.println(x);
} catch (Exception e) {}
finally {
System.out.println("Error");
Answers
Answered by
0
Answer:
Can't understand
Explaination
Answered by
0
Output for the given code is:
4
Error
Here the 'for loop' ends doesn't have a body. Now, the for loop will run from till and then will come out of loop with value of 'i' as .
Now the next step is a statement which prints the current value of 'i' as .
After that the controls goes to the final statement and also prints "Error" whatever the upper code is.
#SPJ2
Similar questions