GIAC
GSSP-JAVA · Question #88
GSSP-JAVA Question #88: Real Exam Question with Answer & Explanation
Sign in or unlock GSSP-JAVA to reveal the answer and full explanation for question #88. The question stem and answer options stay visible for context.
Question
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?
Options
- ACompilation will fail.
- BThe program will print abc xyz 123 no when run.
- CThe program will print xyz 123 no when run.
- DThe program will print abc 123 no when run.
Unlock GSSP-JAVA to see the answer
You've previewed enough free GSSP-JAVA questions. Unlock GSSP-JAVA for full answers, explanations, the timed quiz mode, progress tracking, and the master PDF. Question stem and options stay visible so you can still see what's on the exam.