/* 1 */ class T2 {
/* 2 */ int j = i;
/* 3 */ static final int i = 10;
/* 4 */ static void main (
String [] args) {
/* 5 */
/* 6 */ b = i + 1 > 4;
/* 7 */ boolean b = (boolean) i;
/* 8 */ i = (int) b;
/* 9 */ System.out.println(b);
/* 10 */
/* 11 */ }
}
/*
Which lines generate compile time errors (circle all that apply)
1
2
3
4
5
6
7
8
9
*/
I made this question up, so you will have trouble finding it on any other sites. However, I also made up the syntax, with the line numbers over on the left in comments. I think this represents a substantial improvement over many other code examples- because you can cut and paste it and compile it immediately! No mucking around with editing. I hope others adopt this standard.
However, I am not sure where to post the answers- I hope you try compiling it you may be surprised at the results in multiple places.
[ September 03, 2004: Message edited by: Tom Tolman ]
[ September 03, 2004: Message edited by: Tom Tolman ]