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

Which is greatest 895mm or 8,98mm?
Why was Brown V. Board of Education argued twice in front of Supreme Court in 1954 and 1955?
What is 1/8 x 3/8 and how do you do the problem??????
Carmen listed the multiples of 6 as 1,2,3,  and 6. Is she correct? Explain why or why not.
A total of 350 signatures is needed for a petition to be considered by the town legislature. If 125 signatures have already been obtained, what percentage of th
I need a sentence with the word classify
what's another word for genetic variation
Which event of the cell cycle takes the longest period of time and why
39.42 divided by 5.4
HELP PLEASE If the radius of the base of the cone, r, is 2 feet and the height,h, is 12 feet, what is the volume of the cone?