Java Practice-it | Primitive Data and Definite Loops | Self-Check 2.13 : valuesOfABC

preview_player
Показать описание
Topics:
basics, mystery, variables

Question:
What are the values of a, b, and c after the following code statements? (It may help you to write down their values after each line.)
int a = 5;
int b = 10;
int c = b;
a = a + 1;
b = b - 1;
c = c + a;

Problem:
Рекомендации по теме
Комментарии
Автор

i don't understand why the a variable gets redeclared but not the b. why is b 10 and not 9 like how a changed from 5 to 6

alexsmith