Question #500197

Small Java Question.?

switch (x) { case 3 : x += 1; case 4 : x += 2; case 5 : x += 3; case 6 : x++; case 7 : x += 2; case 8 : x--; case 9 : x++ } If x is currently equal to 5, what will the value of x be after the switch statement executes? A.5 B.6 C.7 D.8 The thing is I got 11 and that's not one of the answers. I did..5+1+2+3=1 I also ran the code and got the same answer.

2012-09-27 16:22:27

TELL US , if you have any answer

Sponsored ads

There is NEVER a problem, ONLY a challange!

The helpinganswers.com is a free-to-use knowledgebase.
  The helpinganswers.com was started on: 02.07.2010.
  It's free to register. Once you are a registered user, you can ask questions, or answer them.
  (Unless registration you can just answer the questions anonymously)
  Only english!!! Questions and answers in other languages will be deleted!!

Cheers: the PixelFighters

  Contact: support@helpinganswers.com

C'mon... follow us!

Made by, history, ect.