Saturday 9 March 2013

MCQ #5

Question) In switch construct , the default statement must be placed after all the case statements.

Options)

  • True
  • False
Answer) False

Explanation) Go through the Java tutorial on switch statement to know more about switch statement and it's usage.As for our question, default statement can be put anywhere in the switch construct but it will be called only when none of the other cases match. Also since default statement is the last one to be checked we need not even write break statement in default statement.So the answer is clearly False.

No comments:

Post a Comment

t> UA-39527780-1 back to top