black

SCJP程序员认证考试

登录

单项选择题

public class Wow { 
public static void go(short n) {System.out.println(”short”); } 
public static void go(Short n) {System.out.println(”SHORT”);} 
public static void go(Long n) {System.out.println(” LONG”); } 
public static void main(String [] args) { 
Short y= 6; 
int z=7; 
go(y); 
go(z); 
} 
} 
What is the result?() 

A. short LONG
B. SHORT LONG
C. Compilation fails.
D. An exception is thrown at runtime.

相关考题

单项选择题 public class Yikes {  public static void go(Long n) {System.out.println(”Long “);}  public static void go(Short n) {System.out.println(”Short “);}  public static void go(int n) {System.out.println(”int “);}  public static void main(String [] args) {  short y= 6;  long z= 7;  go(y);  go(z);  }  }  What is the result?()

多项选择题 public class TestString3 {  public static void main(String[] args) {  // insert code here  System.out.println(s);  }  }  Which two code fragments, inserted independently at line 3, generate the output 4247?()

单项选择题 public String makinStrings() {  String s = “Fred”;  s = s + “47”;  s = s.substring(2, 5);  s = s.toUpperCase();  return s.toString();  }  How many String objects will be created when this method is invoked?()

All Rights Reserved 版权所有©易学考试网(yxkao.com)

备案号:湘ICP备2022003000号-3