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
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".