设为首页 加入收藏

TOP

Java之对象引用static变量
2014-11-23 20:20:37 】 浏览:2296
Tags:Java 对象 引用 static 变量

  如下面代码


  Java代码


  public class Test


  {


  public static int a = 2;


  public static void main(String[] args)


  {


  Test t = new Test();


  t = null;


  System.out.println(t.a);


  }


  }


  输出为:


  2


  下面的代码


  Java代码


  public class Test


  {


  public static int a = 2;


  public int b = 3;


】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇文本框获得焦点时气泡弹出提示框 下一篇javascript动态生成表格

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目