What is null in Java?

Is null an instance of anything? No, there is no type which null is an instanceof. 15.20.2 Type Comparison Operator instanceof RelationalExpression: RelationalExpression instanceof ReferenceType At run time, the result of the instanceof operator is true if the value of the RelationalExpression is not null and the reference could be cast to the ReferenceType without … Read more

Method Overloading for null argument

Java will always try to use the most specific applicable version of a method that’s available (see JLS ยง15.12.2). Object, char[] and Integer can all take null as a valid value. Therefore all 3 version are applicable, so Java will have to find the most specific one. Since Object is the super-type of char[], the … Read more