Multiple choice

For formatted output of string class, we use

  1. %c

  2. %d

  3. %f

  4. %s

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

For formatted output of strings, %s is the correct format specifier. %c is for characters, %d for decimal integers, and %f for floating-point numbers. printf() and String.format() use these specifiers - %s specifically handles string output.