java里所有的类都源于Object
基本数据类型不是类,除外。。

解决方案 »

  1.   

    你能编译通过?我晕
    P.println(100); 100是int类型,而你的P.println(Object) 要求Object 参数类型首先过不去!!!!
      

  2.   

    only the string line can pass the compilation. why couldn't Int? Isn't the primitive types an Object?
      

  3.   

    because String is a object,so it can pass to the function rintln,
    primitive is not a Object.
      

  4.   

    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.
      

  5.   

    1、你的P里面的方法为rintln
    2、100为基本数据类型,必须转化为对象才可以
    像new Integer(100) 或者new Double(100)