In the following two Java output statements, System.out.println("Hello. Welcome to this program."); System.out.print("Tell me your favorite number: "); why do you think the first uses println and the second uses print?

Respuesta :

The first statement show that after print the statement, the compiler will leave the line and start the next statement on fresh line.

While the second statement show that after print statement the compiler will continue print next statement without drop to another line.