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

Just started ratio, I need some help, please!
How do I solve this and please be helpful
HELP ME PLZZZ!!!Examine the following map showing the Olmec heartland and the southern Maya empire. Based on the map, which of the following statements is most
Sound waves have 4 basic properties including amplitude, wavelength and a)distance b)media c)speed d)pitch
the electric force between two charged objects depends on
Describe the Settlement House Movement.
what adaption is used by polar bears to maintian homeostasis in cold temperature
Match the vocabulary terms to the correct definition. 1. the time of life between childhood and adulthood assault 2. a crime involving physical violence or th
is this right i dont know smo help
How much power should a leader have within a democracy?