class ThrowNull { public static void main(String[] args) { throw null; } }
We know that rule for throw is throw ThrowableInst
throw ThrowableInst
I think because Null can be cast in to any type of reference.so in compile time its nothing wrong if you are throwing null instead of throwable.