View Single Post
  #1 (permalink)  
Old 08-01-2007, 05:30 PM
baltimore baltimore is offline
Member
 
Join Date: Jul 2007
Posts: 40
baltimore is on a distinguished road
Problem with a switch statement in Java
I've been having this odd problem with a switch statement in Java.

The problem I'm having is that the switch statement doesn't seem to be recognizing the correct input. As an example, I'm checking for various characters, and i read them in as ints. The ASCII code for a ':' is 58, and when I test it like this:

Code:
if( input == 58){ do stuff; }
it works fine, but the same input in a switch statement doesn't do anything:
Code:
switch( input){ case 58: do stuff: break; }
Thanks.
Reply With Quote
Sponsored Links