Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

switch type

 
reubin haz
Ranch Hand
Posts: 287
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Answers b and c are correct. But why a is incorrect?

Someone please explain.
 
shetal bansal
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Because the maximum value a byte can take is 127, so the switch case which have values greater than 127(e.g 200,300) will give compilation error.
[ June 22, 2005: Message edited by: shetal bansal ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic