Still in the spirit of Java Puzzlers; can you provide declarations for i and j to make this statement fail at runtime?
i = j;
I spent quite some time debugging this, once...
Still in the spirit of Java Puzzlers; can you provide declarations for i and j to make this statement fail at runtime?
i = j;
2 comments:
Integer j = null;
int i;
i = j;
??
Quite right. Any other boxed primitive/primitive pair would work just as well.
Post a Comment