Just wondering System.out.println()

后端 未结 6 1853
故里飘歌
故里飘歌 2021-01-24 10:53

Just asking if I have the right understanding

System.out.println();

System is the package out is the class println() is the method

If t

6条回答
  •  执念已碎
    2021-01-24 11:21

    No,

    • System is the class, which resides in java.lang package (that's why you don't need to import it).
    • out is a static variable of System class. It is public, so that you can access it from outside and it is static so that you it's associated to the class declaration and not to any instance of it.
    • println() is a method, indeed. And it is a method of out variable, which is a PrintStream instance.

提交回复
热议问题