Why Java does not allow null while declaring primitive data types [duplicate]
问题 This question already has answers here : Why can't primitive data types be “null” in Java? (8 answers) Closed 6 years ago . This is in continuation to my previous question and accroding to answers of this question Declaration of wrapper classes Java wraps primitive data type to wrapper classes then why char c = null; // invalid int i = null; // invalid is not allowed but Character cObj = null; // valid Integer iObj = null; // valid is allowed. 回答1: Because primitives represent value and