Answer can be "false" because there is no information about break statement.
So the default statement will execute even a case value matches switch() argument, for example:
From where you get this question. This is not the right forum to post it. What is the complete question? Because if no match found then also default case will be executed.
Life is easy because we write the source code.....
Welcome to JavaRanch, and thanks for the feedback!
I believe the answer is correct as it stands. It says that the default clause will execute if no case matches, and that's absolutely true. It's possible that the default will execute if a case matches, also -- but that doesn't make the original statement false. If the question had said "True or false: the default clause will only execute if no case matches", then I would agree with you, but it does not say that.
Ernest Friedman-Hill wrote:If the question had said "True or false: the default clause will only execute if no case matches", then I would agree with you, but it does not say that.
Hi, Sergey , Actually I don't know about the JavaRanch Rule Round-up Game therefore I had asked that questions. but now I got my mistake. Thanks I will also check JavaRanch Rule Round-up Game.
Life is easy because we write the source code.....