isaiahhardie63751 isaiahhardie63751
  • 10-09-2020
  • Computers and Technology
contestada

Consider the following code segment. int j = 10; int k = 8; j += 2; k += j; System.out.print(j); System.out.print(" "); System.out.println(k); What is printed when the code segment.

Respuesta :

StreetFighterLan123
StreetFighterLan123 StreetFighterLan123
  • 10-09-2020

Answer:

12 20

Explanation:

alright so, lets keep track of our variables

j+= 2 is j = j+2

so j is 12, and k += j is k = k + j so k is then 20.

j=12, k=20

It would print

12 20

because of the "space" on your second print statement, and the third would create a new line AFTER printing itself first.

Answer Link

Otras preguntas

How did the homestead act greatly impact the American Indians of the Great Plains
How many moles of oxygen are in 3.0 moles c6h12o6 ? Help!!
Choose the statements that are true about bonds. A.If atoms have a big electronegativity difference, they form an ionic bond. B.In ionic bonds, electrons are s
What is the poetic term for rhythm? A. lyrics B. beat C. meter D. ode
[H2O] = 0.077 M [Cl2O] = 0.077 M [HClO] = 0.023 M What is the equilibrium constant for the reaction at this temperature?
Which of the following events do historians usually credit as having started the atomic age?
Read the excerpt below and answer the question. ...those days are ill-defined in my memory, running together and combining like a fresh watercolor painting left
Why do the tannery officials visit Rukmani after Raja's death? A.)They want to express their condolences. B.)They want to return Raja's personal items from the
Identify the type of body movement sitting up straight. 1. adaptor 2. emblem 3. illustrator 4. affect display 5. regulator
importance of opening scene in merchant of venice
good job