首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > 编程 >

有趣的代码1

2012-11-07 
有趣的代码一public class Test {private static String LOCATION static Integer x 1 static Integer

有趣的代码一

public class Test {private static String LOCATION; static Integer x = 1; static Integer y = 1; static Integer x1=11111; static Integer y2=11111;public static void main(String[] args) {        new B();      System.out.print(LOCATION);      System.out.println(x==y);      System.out.println(x1==y2);}}class A{private Integer x = 1;public  Integer getX(){System.out.println("geta");return x;}public A(){System.out.println(getX());}}class B extends A{private static  Integer x = 2;public  Integer getX(){System.out.println("getb");return x;}}
?

热点排行