public class Short { public static void main(String[] args) { StringBuffer s = new StringBuffer(“Hello”); if ((s.length() > 5) && (s.append(“there”).equals(“False”))); //do nothing System.out.println(“value is : ” + s); } }; Cho biết kết quả sau khi thi hành chương trình sau:

public class Short {

public static void main(String[] args) {

StringBuffer s = new StringBuffer(“Hello”);

if ((s.length() > 5) && (s.append(“there”).equals(“False”))); //do nothing

System.out.println(“value is : ” + s);

}

};

Cho biết kết quả sau khi thi hành chương trình sau:

A. Giá trị xuất là Hello

B. Lỗi biên dịch tại dòng 4 và 5

C. Không có giá trị xuất

D. Thông báo NullPointerException

Hướng dẫn

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

 

Thư viện tài liệu12 Tháng bảy, 2023 @ 2:30 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