Pagina de inicio
/
Tecnología
/
What will this code segment output? System.out.println("Hello"); System.out.println("world"); Hello World Helloworld Hello World Hello World

Problemas

What will this code segment output?
System.out.println("Hello");
System.out.println("world");
Hello
World
Helloworld
Hello World
Hello
World

What will this code segment output? System.out.println("Hello"); System.out.println("world"); Hello World Helloworld Hello World Hello World

Solución

avatar
Lorenzomaestro · Tutor durante 5 años
expert verifiedVerificación de expertos
4.2 (325 votos)

Responder

This code segment will output:<br />```<br />Hello<br />world<br />```<br />The `System.out.println()` method is used to print text to the console. In this case, it is used twice, once to print "Hello" and once to print "world". Each of these strings is printed on a new line, so the output consists of two lines with the text "Hello" on the first line and "world" on the second line.
Haz clic para calificar: