多做题,通过考试没问题!

Java认证考试

睦霖题库>其他计算机考试>Java认证考试

10. public class Hello {  11. String title;  12. int value;  13. public Hello() {  14. title += “ World”;  15. }  16. public Hello(int value) {  17. this.value = value;  18. title = “Hello”;  19. Hello();  20. }  21. }  and:  30. Hello c = new Hello(5);  31. System.out.println(c.title);  What is the result?() 

  • A、 Hello
  • B、 Hello World
  • C、 Compilation fails.
  • D、 Hello World 5
  • E、 The code runs with no output.
  • F、 An exception is thrown at runtime.
正确答案:C
答案解析:
进入题库查看解析

微信扫一扫手机做题