1.

In the below code, which code fragment should be inserted at line 3 so that the output will be: 234pqr 234pqr ?

1. StringBuilder strbuilder = new StringBuilder("234");
2. String str = "234";
3. // insert code here
4. System.out.println(strbuilder + " " + str);

A. strbuilder .append( pqr ); str.concat( pqr );
B. strbuilder .append( pqr ); str1 = str1.concat( pqr );
C. strbuilder .append( pqr ); str.append( pqr );
D. strbuilder .concat( pqr ); str.append( pqr );
E. None of these
Answer» C. strbuilder .append( pqr ); str.append( pqr );


Discussion

No Comment Found

Related MCQs