black

SCJP程序员认证考试

登录

单项选择题

public class Test { 
public static void leftshift(int i, int j) { 
i<<=j; 
} 
public static void main(String args[])  { 
int i = 4, j = 2; 
leftshift(i, j); 
 System.out.printIn(i);
} 
}    
What is the result?()  

A. 2
B. 4
C. 8
D. 16
E. The code will not compile.

相关考题

单项选择题 public class SyncTest {  private int x;  private int y;  public synchronized void setX (int i) (x=1;)  public synchronized void setY (int i) (y=1;)  public synchronized void setXY(int 1)(set X(i); setY(i);)  public synchronized Boolean check() (return x !=y;)  }  Under which conditions will check () return true when called from a different class?

单项选择题 1. public class X implements Runnable(  2. private int x;  3. private int y;  4.    5. public static void main(String[]args)  6. X that = new X();  7. (new Thread(that)).start();  8. (new Thread(that)).start();  9. )  10.    11. public void run()  (  12. for (;;)  (  13. x++; 14. y++;  15. System.out.printIn(“x=” + x + “, y = ” + y);  16.     ) 17. ) What is the result?()

单项选择题 Whichstatementistruefortheclassjava.util.ArrayList?()

All Rights Reserved 版权所有©建筑考试题库(jzkao.com)

备案号:湘ICP备2020024380号-3