public class S1 { public static void main(String[] args) { new S2(); } S1() { System.out.print(“S1”); } } class S2 extends S1 { S2() { System.out.print(“S2”); } } Hãy cho biết kết xuất của đoạn chương trình sau :

public class S1 {

public static void main(String[] args) {

new S2();

}

S1() {

System.out.print(“S1”);

}

}

class S2 extends S1 {

S2() {

System.out.print(“S2”);

}

}

Hãy cho biết kết xuất của đoạn chương trình sau :

A. S1

B. S2

C. S1S2

D. S2S1

Hướng dẫn

Chọn C là đáp án đúng

 

Thư viện tài liệu12 Tháng bảy, 2023 @ 2:31 chiều

Đánh giá chủ đề này
How to whitelist website on AdBlocker?

How to whitelist website on AdBlocker?

  1. 1 Click on the AdBlock Plus icon on the top right corner of your browser
  2. 2 Click on "Enabled on this site" from the AdBlock Plus option
  3. 3 Refresh the page and start browsing the site