Given these baby classes
public class Domain<V> {
public Domain(V v) {} // (1)
public Domain() {} // (2)
}
and
public class User {}
and a client
public class App {
public static void main( String[] args )
{
Domain<User> d1 = new Domain<>(new User());
Domain<User> d2 = new Domain<>(null);
}
}
Which constructor is it going to hit, (1) or (2)?
Spoiler: its one
What's the story behind that? It implies, that null
is while effectively nothing, still an argument or what?