LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1523|回复: 1

问一个弱弱的问题

[复制链接]
发表于 2008-3-26 10:17:17 | 显示全部楼层 |阅读模式
System的所有方法都是static方法,可访问字段都是static的,这里说的访问字段是什么意思?像System.out.println()中,out该怎么理解?
发表于 2008-3-26 19:41:54 | 显示全部楼层
  1. public class Test {
  2.     public int a;  // 字段
  3.     public void test() {} // 方法
  4. }
复制代码


  1. public final class System {
  2.     ...
  3.     public final static PrintStream out = nullPrintStream();
  4.     ...
  5. }
复制代码
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表