GIAC
GSSP-JAVA · Question #139
GSSP-JAVA Question #139: Real Exam Question with Answer & Explanation
The correct answer is B. It will compile and execute successfully and will display Hi as the output.. See the full explanation below for the reasoning.
Question
You work as a Software Developer for UcNet Inc. You write the following code using Java. class StringTest { public static void main(String args[]) { String s = "Hi"; concat("There"); System.out.println(s); } } What will happen when you try to compile and execute the code?
Options
- AIt will not compile.
- BIt will compile and execute successfully and will display Hi as the output.
- CIt will compile but will throw an exception at runtime.
- DIt will compile and execute successfully and will display HiThere as the output.
Community Discussion
No community discussion yet for this question.