Kazley82271 Kazley82271
  • 04-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 :

codiepienagoya codiepienagoya
  • 04-09-2020

Answer:

Following are the output of the given code:

Output:

12 20

Explanation:

Description of the code:

  • In the java program code, two integer variable "j and k" is defined, that stores a value, that is "10 and 8", in its respective variable.
  • After storing the value it uses the "j and k" variable, in this, it increments the value of j with 2, and in the k variable, it adds the value of j and stores the value in k.
  • After incrementing the value, the print method is used that prints the value of "j and k", i.e, "12 and 20".
Answer Link

Otras preguntas

Thực dân Anh lần lượt xâm chiêm và lập 13 thuộc địa ở Bắc Mĩ vào khoảng thời gian nào? *
Your teacher gives you an assignment to create a video on 1950s Cold War events. You decide you want to Include collage of Cold War-era propaganda. Considering
Using the information learned from the pendulum demonstration, when the pendulum is at it's lowest point, what type of energy does it have and WHY?
whats a better ending to the story "the gift of the Magi"?​
A school has 600 pupils. 1/5 are in the upper school, 1⁄4 in the middle school and the remainder in the lower school. How many pupils are in the lower school?
what is black hole mnq///oxqh///pvr​
help me again please?​
How did direct action Birmingham according to dr king develop overtime
Can you please help me can you do plsssssssss help me
b. A number y minus 75.​