KnowledgeBoat Logo
|

Computer Applications

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

Input in Java

ICSE 2018

30 Likes

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.

Answered By

12 Likes