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

The deepest portion of the lithosphere is formed from
Write and solve an equation to find the value of each variable
Jeanette purchased a concert ticket on a web site.The original price of the ticket was $75.She used a coupon code to receive a 20% discount.This website applied
Last night, Poison Ivy activated a canister of tear gas. When the gas was at its strongest, it’s density was 129,059 parts per million. After 62 minutes, the ga
find the length of the base indicated for each trapezoid
Joelle plans to sell two types of balloons at her charity event: 171717‑inch latex balloons that require 222 cubic feet (\text{ft}^3)(ft 3 )left parenthesis,
What is Rubisco and its relationship to photosynthesis?
What’s the surface area
Can someone help me with question 6 please?
why did the wright brothers construct their own wind tunnel?