Câu 14: GSSP-Java: GIAC Secure Software Programmer-Java
You write the following code.class Father {public void Method() {System.out.println("I am Father");}} public class Son extends Father {public static void main(String argv[]) {Son son = new Son();son.Method();} private void Method() {System.out.println("I am Son");}}Which of the following will be the result, when you t…
Nội dung câu hỏi
You write the following code.class Father {public void Method() {System.out.println("I am Father");}} public class Son extends Father {public static void main(String argv[]) {Son son = new Son();son.Method();} private void Method() {System.out.println("I am Son");}}Which of the following will be the result, when you try to compile and run the code?
Các lựa chọn
Đáp án được giữ gọn theo nhãn A, B, C, D trong phần bình chọn tương tác.
- A. I am Father will be displayed as the output.
- B. A runtime error will result.
- C. I am Son will be displayed as the output.
- D. The code will execute but without displaying any output.
- E. A compile-time error will result. — đáp án hiện tại
Cộng đồng
0 bình luận công khai. Tên thành viên được ẩn một phần.