天启黑马信息科技(北京)有限公司 后端开发工程师 笔试题
关于
1年前
更新
4
频次
25
题目数
分享

有问题?问问AI帮你修改 改主题:如咖啡问卷改为奶茶问卷
感谢您能抽出几分钟时间来参加本次答题,现在我们就马上开始吧!
Q1:姓名
Q2:手机
Q3:邮箱
Q4:boss上显示的名称
Q5:package testpkg.p1;public class ParentUtil { public int x = 420; protected int doStuff() { return x; }}package testpkg.p2;import testpkg.p1.ParentUtil;public class ChildUtil extends ParentUtil { public static void main(String [] args) { new ChildUtil().callStuff(); } void callStuff() { System.out.print(this + this.doStuff() ); /* Line 18 */ ParentUtil p = new ParentUtil(); System.out.print( parent + p.doStuff() ); /* Line 20 */ }}下列说法正确的是:
Q6:哪个集合类允许扩大或缩小其大小,并提供对其元素的索引访问,但其方法不是同步的(synchronized)?
Q7:哪种方法不会直接导致线程停止
Q8:class X implements Runnable { public static void main(String args[]) { /* Missing code? */ } public void run() {} }下列哪种方法可以启动线程?
Q9:哪三个保证一个线程会离开运行状态yield()wait()notify()notifyAll()sleep(1000)aLiveThread.join()Thread.killThread()
Q10:int i = l, j = -1;switch (i) { case 0, 1: j = 1; /* Line 4 */ case 2: j = 2; default: j = 0; } System.out.println(j = + j); 程序的输出是?
Q11:public class SwitchTest { public static void main(String[] args) { System.out.println(value = + switchIt(4)); } public static int switchIt(int x) { int j = 1; switch (x) { case l: j++; case 2: j++; case 3: j++; case 4: j++; case 5: j++; default: j++; } return j + x; } }程序的输出是?
Q12:关于java.util.HashSet下列说法正确的是?
Q13:public class RTExcept { public static void throwit () { System.out.print(throwit ); throw new RuntimeException(); } public static void main(String [] args) { try { System.out.print(hello ); throwit(); } catch (Exception re ) { System.out.print(caught ); } finally { System.out.print(finally ); } System.out.println(after ); }}程序的输出是?
Q14:class A { public A(int x){} } class B extends A { } public class test { public static void main (String args []) { A a = new B(); System.out.println(complete); } }程序的输出是?
Q15:String x = xyz;x.toUpperCase(); /* Line 2 */String y = x.replace(Y, y);y = y + abc;System.out.println(y);程序的输出是?
Q16:public class StringRef { public static void main(String [] args) { String s1 = abc; String s2 = def; String s3 = s2; /* Line 7 */ s2 = ghi; System.out.println(s1 + s2 + s3); }}程序的输出是?
Q17:public void foo( boolean a, boolean b){ if( a ) { System.out.println(A); /* Line 5 */ } else if(a b) /* Line 7 */ { System.out.println( A B); } else /* Line 11 */ { if ( !b ) { System.out.println( notB) ; } else { System.out.println( ELSE ) ; } } }
Q18:class Bitwise { public static void main(String [] args) { int x = 11 9; int y = x ^ 3; System.out.println( y | 12 ); }}程序的输出是?
Q19:public class X { public static void main(String [] args) { String names [] = new String[5]; for (int x=0; x args.length; x++) names[x] = args[x]; System.out.println(names[2]); }}运行如下命令:java X a b程序的输出是?
Q20:您希望一个类可以访问同一个包中另一个类的成员。 实现这一目标的最严格的访问是什么?
Q21:程序的输出是?public class Test107 implements Runnable { private int x; private int y; public static void main(String args[]) { Test107 that = new Test107(); (new Thread(that)).start(); (new Thread(that)).start(); } public synchronized void run() { for(int i = 0; i 10; i++) { x++; y++; System.out.println(x = + x + , y = + y); /* Line 17 */ } } }
Q22:下列说法正确的是
Q23:下列说法正确的是
Q24:public class Test { public void foo() { assert false; /* Line 5 */ assert false; /* Line 6 */ } public void bar() { while(true) { assert false; /* Line 12 */ } assert false; /* Line 14 */ } }哪一个会导致编译失败
Q25:请用java实现一个函数。输入是一个数组,数组的元素都是数字,里面的数字有重复出现的。函数返回一个新的数组,是对输入数组去重的结果
联系我们
问卷网公众号