Which of the following are legal? (Choose all that apply.)
length()
<10; s += '!') A, B, D.
A and B are using multiple initialization and increment parts, which are legal.
In B, the test part is empty, so the loop will run forever unless it hits a break statement, throws an exception, or does something equally.
C is illegal because only one type may be declared in the initialization.
D is correct because it uses strings rather than the more commonly seen ints.