Javascript does. Switch in java also works with chars. -Tim -----Original Message----- From: Yee, Richard K,,DMDCWEST [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 11:48 AM To: 'Struts Users Mailing List' Subject: RE: switch statement
Keith, The switch statement doesn't work with all primitive types. It only works with ints. I don't know of any other language that has a switch statement that works with a string type. An if-else if-else block can easily implement the functionality of a switch statement. Regards, Richard > -----Original Message----- > From: Kamholz, Keith (corp-staff) USX [SMTP:[EMAIL PROTECTED] > Sent: Thursday, June 05, 2003 8:06 AM > To: Struts (E-mail) > Subject: switch statement > > Hey everyone, > This is more of a Java question than a Struts question, I hope you all > don't > mind. > > I'm just wondering if there is any way to use a String for a switch > statement, or if you are restricted to the true primitive types. > I haven't found a way, but it seems like something that lots of people > would > want that wouldn't be hard for the Java developers to allow for. > Wouldn't you agree? > > > Keith Kamholz > Programming and Architecture > Moog Inc. > > Phone: (716) 687-7001 > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

