Java Past Paper - Is it just me or wording of this switch statement q is making it unsolvable? -
i have been revising exam , have found question in 1 of past papers (at least me) seem unsolvable. have attach picture because has been scanned , saved set of images.
you can't tell output of code when taking consideration values sub questions because no actual parameter being passed method , switch statement. understanding correct, or missing something?
i agree - without knowing value of num is, can't decide output is. maybe there typo , method supposed be:
public static void compute(int value) { switch(value) {...} }
in case answer should take account fact if change value
in 1 of case statements, original value used decide if other case statements should executed (in other words, 1 case statement can executed).
Comments
Post a Comment