Multiple choice

Which of the following is the correct printf() statement in Java?

  1. printf(“Hello”);

  2. Printf“Hello”;

  3. System.out.printf(“Hello”);

  4. None of the above

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

We can also use the printf() statement in Java like C language. The correct way to display using printf() method is System.out.printf(“Hello”);