only the string line can pass the compilation. why couldn't Int? Isn't the primitive types an Object?
because String is a object,so it can pass to the function rintln, primitive is not a Object.
sagittarius1979(射手爱狮子) is right. thank you. and i think i've got misguided by my book. it's not easy to find a good book now. anyway, thank you very much.
P.println(100); 100是int类型,而你的P.println(Object) 要求Object 参数类型首先过不去!!!!
primitive is not a Object.
and i think i've got misguided by my book. it's not easy to find a good book now.
anyway, thank you very much.
2、100为基本数据类型,必须转化为对象才可以
像new Integer(100) 或者new Double(100)