TreyJay3527 TreyJay3527
  • 23-01-2020
  • Computers and Technology
contestada

What will be the output of the following code snippet? boolean token1 = true; while (token1) { for (int i = 0; i < 10; i++) { System.out.println("Hello"); } token1 = false; }

Respuesta :

fabiolashproyectos
fabiolashproyectos fabiolashproyectos
  • 23-01-2020

Answer:

The output of the code snippet will be ten “Hello” messages

Explanation:

while token = true

i = 0 sends “Hello” to the screen

i = 1 sends “Hello” to the screen

i = 2 sends “Hello” to the screen

i = 3 sends “Hello” to the screen

i = 4 sends “Hello” to the screen

i = 5 sends “Hello” to the screen

i = 6 sends “Hello” to the screen

i = 7 sends “Hello” to the screen

i = 8 sends “Hello” to the screen

i = 9 sends “Hello” to the screen

 

Answer Link

Otras preguntas

Which is a key qualification for someone who assembles scientific engineering products?.
Which best represents a central idea of the passage?
Select the correct answer. What is the vertex of the parabola given by y = -(x − 2)^2 − 1?
how mountain high schools community-service requirements support president kennedy vision
Describe the major events/battles of the war of 1812. You must include the Battle of New Orleans and how it made Andrew Jackson a hero.​
What is the range of the function f(x) = VX-8 +6?
what percent is 20 out of 80?
Are there hackers on this website? And what happens when they are caught?
WHat is the capitol of greece? Need to know
A spinner is divided into five sections labeled A, B, C, D, and E. Bobby spins the spinner 50 times and records the results in the table. Use the results to pre