CertyRush
Đang tải...
C CertyRush
Câu hỏi free preview

Câu 5: GSSP-Java: GIAC Secure Software Programmer-Java

You work as a Programmer for InfoTech Inc. You write the following code.1. public class InnerDemo{2. public static void main(String[] args) {3. Car c = new Car();4. // insert code here5. e.test();6. }7. }8. class Car{9. class Engine{10. void test() {System.out.println("test"); }11. }12. }Which of the following options…

Nội dung câu hỏi

You work as a Programmer for InfoTech Inc. You write the following code.1. public class InnerDemo{2. public static void main(String[] args) {3. Car c = new Car();4. // insert code here5. e.test();6. }7. }8. class Car{9. class Engine{10. void test() {System.out.println("test"); }11. }12. }Which of the following options should you add to line 4 so that the code compiles and produces the output "test"?

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.

  1. A. Car.Engine e = c.new Engine(); — đáp án hiện tại
  2. B. Engine e = c. new Engine();
  3. C. c.Engine e = Car.new Engine();
  4. D. Car.Engine e = Car.new Engine();

Cộng đồng

0 bình luận công khai. Tên thành viên được ẩn một phần.

Chưa có bình luận. Mở giao diện tương tác để bắt đầu thảo luận.

Câu hỏi liền kề