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

What are the coordinets?
Order the process for writing the critical book review. Select the limits. Find evidence. Know the text. Write the essay. Revise the original outline.
A cookbook cost 3 times as a storybook.A cookbook and 4 storybook cost $112.How much did a storybook cost?
_____ is an important part of the interview process. It allows you to consider how you did in the interview, examining your strong and weak points. a. Active l
Who is the Prime Minister of the United States​
What negative feature of jordan baker's personality is revealed when we find out tom has a woman in new york?
What idea was the basis for President Franklin D. Roosevelt's New Deal programs?
How teasing centers grew into towns
Qiulian and Tammy have 2400 cards.Tammy has twice as many cards as Quilian.How many cards must Tammy give Quilian so that they have the same number of cards?
8.06 Prueba 25 points on this one and my last one I'll be back in 2-3 hours to check again I really need help with this