MCQOPTIONS
Saved Bookmarks
| 1. |
Consider the following Java code segment:public class while /*line1*/{public void loop(){int x=0;while(1) /*line 6*/{System.out.println(“x plus one is” + (x + 1));}}}Which of the following is true? |
| A. | There is a syntax error in line -1 |
| B. | There are syntax errors in, line -1 and line -6 |
| C. | There is a syntax error in line -6 |
| D. | No syntax error |
| Answer» B. There are syntax errors in, line -1 and line -6 | |