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

HELP ASAP PLEASE!! WILL MARK BRAINLIEST !! Read and choose the correct option with the verbs that complete the sentence. -En la mañana, ¿ qué 1.______ usted,
What motivates terrorism?
Someone help me with number 8 only please thank you
Find the area of the circle leave your answer in terms of pi with diameter of 4 yd
ramdom question can device and tecnology cause ADHD
What is the slope of the graph of 4 x + 8 y = 11? A. -2 B. -1/2 C. 1/2 D. 2
Which expression can be used to represent the phrase Lamar decreased his collection of cards by seven
Anita is not sure if she should consider going to college or trade school after she graduates from high school. She decides to ask her mother and three uncles t
Elena finished 4/5 of her science project. Write a fraction equivalent to 4/5
What’s the answer to this question math related