Jul 21, 2009

Solution for java puzzles(2)!

/*Provide declarations for the variables x and i such that*/

public class Tweedledum {
public static void main(String[] args) {
// Put your declarations for x and i here
x += i; // Must be LEGAL
x = x + i; // Must be ILLEGAL
}
}
solution:
// Put your declarations for x and i here
int x=0;
byte i;