顺丰科技2016内部Java基础测试
时长:60分钟 总分:100分
1005浏览 29人已完成答题
题型介绍
题型 | 单选题 | 多选题 |
---|---|---|
数量 | 30 | 9 |
时长:60分钟 总分:100分
1005浏览 29人已完成答题
题型 | 单选题 | 多选题 |
---|---|---|
数量 | 30 | 9 |
public class Test { public int x; public static void main(String args[]) { System. out. println("Value is" + x); } }对于上面这段代码,以下说法正确的是:
class A { private String a = “aa”; public boolean methodB() { String b = “bb”; final String c = “cc”; } }
public class Test{ static int cnt = 6; static{ cnt += 9; } public static void main(string[] args){ System.out.println(“cnt =” + cnt); } static{ Cnt /=3; }; }Cnt的值是( )
Integer i01 = 59; int i02 = 59; Integer i03 = Integer.valueOf(59); Integer i04 = new Integer(59);以下输出结果为false的是?
class X{ Y y=new Y(); public X(){ System.out.print("X"); } } class Y{ public Y(){ System.out.print("Y"); } } public class Z extends X{ Y y=new Y(); public Z(){ System.out.print("Z"); } public static void main(String[] args) { new Z(); } }
public class Test { private int x; public Test() { x = 35; } public void Test(double f) { this.x = (int)f; } public Test(double f) { this.x = (int)f; } public Test(String s) {} }
public static void main(String args[]) { Thread t = new Thread() { public void run() { pong(); } }; t.run(); System.out.print("ping"); } static void pong() { System.out.print("pong"); }
public class ZeroTest { public static void main(String[] args) { try{ int i = 100 / 0; System.out.print(i); }catch(Exception e){ System.out.print(1); throw new RuntimeException(); }finally{ System.out.print(2); } System.out.print(3); } }
public class Demo{ public static void main(String args[]){ int num = 10; System.out.println(test(num)); } public static int test(int b){ try { b += 10; return b; } catch(RuntimeException e) { } catch(Exception e2) { } finally { b += 10; return b; } } }