Câu 67: GSSP-Java: GIAC Secure Software Programmer-Java
Mary works as a Software Developer for ABC Solutions Inc. She writes the following code. public class StringMethods { public static void main(String[] args) {String str = new String("abc");str.concat("xyz");StringBuffer strBuf = new StringBuffer(" 123");strBuf.append(" no");System.out.println(str + strBuf);}}What will…
Nội dung câu hỏi
Mary works as a Software Developer for ABC Solutions Inc. She writes the following code. public class StringMethods { public static void main(String[] args) {String str = new String("abc");str.concat("xyz");StringBuffer strBuf = new StringBuffer(" 123");strBuf.append(" no");System.out.println(str + strBuf);}}What will be the output when Mary tries to compile and execute 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. Compilation will fail.
- B. The program will print abc xyz 123 no when run.
- C. The program will print xyz 123 no when run.
- D. The program will print abc 123 no when run. — đá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.