Twitter
Essays
Random
« Lazy type expansion | Main | Creating bytecode problems solved »
Wednesday
Aug222007

How to deal with switch statements

Java can only do switch statements based on integer types. JavaScript on the other hand, can switch on any type, and any mixture of types. So each case statement could be a different type. Since this semantic is not mimicked in Java, we have to convert JavaScript switch statements to Java if/else statements.

PrintView Printer Friendly Version

EmailEmail Article to Friend

Reader Comments

There are no comments for this journal entry. To create a new comment, use the form below.

PostPost a New Comment

Enter your information below to add a new comment.

My response is on my own website »
Author Email (optional):
Author URL (optional):
Post:
 
Some HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>