GIAC
GSSP-JAVA · Question #235
GSSP-JAVA Question #235: Real Exam Question with Answer & Explanation
Sign in or unlock GSSP-JAVA to reveal the answer and full explanation for question #235. The question stem and answer options stay visible for context.
Question
Given a code of a class named PrintString that prints a string. 1. public class PrintString{ 2. public static void main(String args[]){ 3. /*insert code here / 4. / insert code here */ 5. System.out.println(str); 6. } 7. } Which of the following code fragments can be inserted in the class PrintString to print the output "4247"? Each correct answer represents a complete solution. Choose all that apply.
Options
- AStringBuilder str= new StringBuilder("123456789");
- BStringBuffer str= new StringBuffer("123456789");
- CStringBuffer str=new StringBuffer("123456789");
- DStringBuilder str= new StringBuilder("123456789");
- EString str="123456789";
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.