black

SCJP程序员认证考试

登录

单项选择题

1. public class ReturnIt { 
2. return Type methodA(byte x, double y) { 
3. return (short)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

相关考题

多项选择题 InwhichtwocasesdoesthecompilersupplyadefaultconstructorforclassA?()

单项选择题 11. public class Test {  12. public void foo() {  13. assert false;  14. assert false;  15. }  16. public void bar(){  17. while(true){  18. assert false;  19. }  20. assert false;  21. }  22. }  What causes compilation to fail?()

单项选择题 interface Beta {}  class Alpha implements Beta {  String testIt() {  return “Tested”;  }  }  public class Main1 {  static Beta getIt() {  return new Alpha();  }  public static void main( String[] args ) {  Beta b = getIt();  System.out.println( b.testIt() );  }  }  What is the result?()

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

备案号:湘ICP备2022003000号-3