Summer Special Sale Limited Time 65% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: vce65

Given a code of a class named PrintString that prints a string.

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.

A.

StringBuilder str= new StringBuilder("123456789");

str.delete(0,3).replace(1,3,"24").delete(4,6);

B.

StringBuffer str= new StringBuffer("123456789");

str.delete(0,3).replace(1,3,"24").delete(4,6);

C.

StringBuffer str=new StringBuffer("123456789");

str.substring(3,6).delete(1,2).insert(1,"24");

D.

StringBuilder str= new StringBuilder("123456789");

str.deleteCharAt(6).replace(1,3,"24").delete(0,3);

E.

String str="123456789";

str=(str-"123").replace(1,3,"24")-"89";

GIAC GSSP-Java Summary

  • Vendor: GIAC
  • Product: GSSP-Java
  • Update on: Jul 25, 2025
  • Questions: 275
Price: $52.5  $149.99
Buy Now GSSP-Java PDF + Testing Engine Pack

Payments We Accept

Your purchase with ExamsVCE is safe and fast. Your products will be available for immediate download after your payment has been received.
The ExamsVCE website is protected by 256-bit SSL from McAfee, the leader in online security.

examsvce payment method