java.lang是一个包,java.lang.*只不过是在import语法里面那样写.引用JAVA发明者Gosling的原著中一句话:The package java.lang is implicitly imported in all code. --------------------------------------------------------------- Together, we can make the world different! http://www.wufuheng.com
1.默认的是java.lang包 2.System是其中的public final class ,final类的成员可直接用:类名.成员形式来调用. 3.out在System中的定义:public static final PrintStream out,System类中将所有的公共方法和变量定义为static的.所以System的所有变量及方法都只能通过类名本身来访问. 4.一系列的print/println方法是PrintStream类的public方法
而System类就是属于这个包的。
---------------------------------------------------------------
Together, we can make the world different!
http://www.wufuheng.com
2.System是其中的public final class ,final类的成员可直接用:类名.成员形式来调用.
3.out在System中的定义:public static final PrintStream out,System类中将所有的公共方法和变量定义为static的.所以System的所有变量及方法都只能通过类名本身来访问.
4.一系列的print/println方法是PrintStream类的public方法