System.out.print("BEST ");
     System.out.println("OF LUCK");

Choose the correct option for the output of the above statements

  1. BEST OF LUCK
  2. BEST
    OF LUCK

Single Choice
Views 71

Answer:

Option 1 — BEST OF LUCK is the correct option.
System.out.print does not print a newline at the end of its output so the println statement begins printing on the same line. So the output is BEST OF LUCK printed on a single line.

Related Articles:

This section is dedicated exclusively to Questions & Answers. For an in-depth exploration of Java Programming Language, click the links and dive deeper into this subject.

Join Our telegram group to ask Questions

Click below button to join our groups.