black

SCJP程序员认证考试

登录

单项选择题

1. public class ReturnIt { 
2. return Type methodA(byte x, double y) { 
3. return (long)x / y * 2; 
4. } 
5. } 
What is the narrowest valid returnType for methodA in line2?()  

A. int
B. byte
C. long
D. short
E. float
F. double

相关考题

单项选择题 public class Test {  public static void main(String[] args) {  int x = 0;  assert (x > 0) ? “assertion failed” : “assertion passed”;  System.out.println(“Finished”);  }  }  What is the result?()

单项选择题 public class X {  public static void main(String [] args) {  try {  badMethod();  System.out.print(“A”);  }  catch (RuntimeException ex) {  System.out.print(“B”);  }  catch (Exception ex1) {  System.out.print(“C”);  }   finally {  System.out.print(“D”);  }  System.out.print(“E”);  }  public static void badMethod() {  throw new RuntimeException();  }  }  What is the result?()

多项选择题 switch(x) {  default:  System.out.println(“Hello”);  }  Which two are acceptable types for x?()

All Rights Reserved 版权所有©财会考试题库(ckkao.com)

备案号:湘ICP备2022003000号-2