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

. class A { 2. final public int method1(int a, int b) {return 0; } 3. } 4. class B extends A { 5. public int method1(int a, int b) { return 1; } 6. } 7. public class Test { 8. public static v

150/259

1. class A {

2. final public int method1(int a, int b) {return 0; }

3. }

4. class B extends A {

5. public int method1(int a, int b) { return 1; }

6. }

7. public class Test {

8. public static void main(Strings args[]) {

9. B b;

10. System.out.println("x = " + b.method1(0, 1));

11. }

12. }

Chương trình sẽ in ra cái gì?

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

x = 0

x = 1

Lỗi biên dịch

x=10

Giải thích

Chọn đáp án C