black

SCJP程序员认证考试

登录

单项选择题

 public class Test { 
public static void replaceJ(string text)  { 
text.replace (‘j’, ‘l’); 
} 
public static void main(String args[])  { 
string text = new String (“java”) 
replaceJ(text); 
system.out.printIn(text); 
} 
}     
What is the result?()  

A. The program prints “lava”
B. The program prints “java”
C. An error at line 7 causes compilation to fail.
D. Compilation succeeds but the program throws an exception.

相关考题

多项选择题 public class Foo {  private int val;  public foo(int v) (val = v;)  }  public static void main (String [] args)  {  Foo a = new Foo (10);  Foo b = new Foo (10);  Foo c = a;  int d = 10;  double e = 10.0;  }  Which three logical expression evaluate to true?()

单项选择题 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?()

单项选择题 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?

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

备案号:湘ICP备2020024380号-3