259 câu trắc nghiệm tổng hợp Java cơ bản có đáp án

Đọc đoạn mã sau: 1: class Super { 2: public Integer getLenght() { return new Integer(4); } 3: } 4: 5: public class Sub extends Super { 6: public Long GetLenght() { return new Long(5); } 7:

209/259

Đọc đoạn mã sau:

1: class Super {

2: public Integer getLenght() { return new Integer(4); }

3: }

4:

5: public class Sub extends Super {

6: public Long GetLenght() { return new Long(5); }

7:

8: public static void main(String[] args) {

9: Super sooper = new Super();

10: Sub sub = new Sub();

11: System.out.println(

12: sooper.getLenght().toString() + "," +

13: sub.getLenght().toString() );

14: }

15: }

Chương trình sẽ in ra thông tin gì?

Chọn một Câu trả lời

4,4

4,5

5,4

5,5

Giải thích

Chọn đáp án A