Find the error in the code segments, and explain how to correct it:
The following code should print the values 1 to 10:
```
n = 1;
while (n < 10) {
System.out.println(n++);
}
```
Error: An improper relational operator is used in the while’s continuation condition.
Correction: Use <= rather than <, or change 10 to 11.
Computer Science & Information Technology
You might also like to view...
A ________ is a form that is embedded within another form, the main form, and is used to view, enter and edit data that is related to data in the main form
A) split form B) subform C) subdatasheet D) linked form
Computer Science & Information Technology
Each member of the Keys enumeration is a(n) ________ representing a keyboard key.
a) string b) double c) Key d) int e) object
Computer Science & Information Technology