3 ms·
Almost EVERYONE I've interviewed, including senior programmers, think that if you do this: void nullThis(Object o) { o = null; } Object o = new
by runT1ME 16y ago
Almost EVERYONE I've interviewed, including senior programmers, think that if you do this:
void nullThis(Object o) {
o = null;
}
Object o = new Object;
nullThis(o);
System.out.println(o.toString());
throws a NPE