Java Challenge #4: Switch Case

Switch case challenge – what will the result be? Don’t test the code. Answer the question by reading it!

Try to solve this challenge before seeing the answer below.

switch_case.jpg

Answer: “MnNeH”. Pretty easy, huh? But the “switch case” command can be tricky. The formula number of heisenberg is 50, so the second case will be executed until the break of the “case 5”, even if the condition is not true.

Java Challenge #4: Switch Case

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s