(Unknown Source) in Exception stack trace
问题 Background This question is related to Why does String.valueOf(null) throw a NullPointerException? Consider the following snippet: public class StringValueOfNull { public static void main(String[] args) { String.valueOf(null); // programmer intention is to invoke valueOf(Object), but instead // code invokes valueOf(char[]) and throws NullPointerException } } As explained in the answer to the linked question, Java's method overloading resolves the above invokation to String.valueOf(char[]),