B.
The use of ! is illegal because x is of int type, not boolean.
publicclass MainClass {
publicstaticvoid main(String[] argv) {
int x = 1;
x = !x;
}
}
Exception in thread "main" java.lang.Error: Unresolved compilation problem:
The operator ! is undefined for the argument type(s) int
at MainClass.main(MainClass.java:5)