nerdexam
Oracle

1Z0-815 · Question #74

Which statement will emoty the contents of a StringBuilder variable named sb?

The correct answer is C. sb.delete(0, sb.length()). See the full explanation below for the reasoning.

Question

Which statement will emoty the contents of a StringBuilder variable named sb?

Options

  • Asb.deleteAll();
  • Bsb.delete(0, sb.size());
  • Csb.delete(0, sb.length());
  • Dsb.removeAll();

How the community answered

(35 responses)
  • A
    9% (3)
  • B
    3% (1)
  • C
    74% (26)
  • D
    14% (5)

Community Discussion

No community discussion yet for this question.

Full 1Z0-815 Practice