LuckyStarr
Programmer
Hi all,
I'm getting a very strange exception in my code and I started suspecting about a switch statement.
I noticed that it evaluates a byte, but I've never seen a code like this, I learned that the switch only evaluates integer expressions. Even the java tutorial doesn't mention anything about bytes, only integers.
Is the code wright or wrong? I would test myself, but the problem only occurs with a very far away customer.
Example Code:
public static final byte FORM_DATE = 3;
...
byte form = ...;
...
try{
switch(form){
case FORM_DATE: "do something"
break;
default: throw new IllegalArgumentException( "Invalid form = " + form );
}
}
---
There is no Knowledge that is not power
---
I'm getting a very strange exception in my code and I started suspecting about a switch statement.
I noticed that it evaluates a byte, but I've never seen a code like this, I learned that the switch only evaluates integer expressions. Even the java tutorial doesn't mention anything about bytes, only integers.
Is the code wright or wrong? I would test myself, but the problem only occurs with a very far away customer.
Example Code:
public static final byte FORM_DATE = 3;
...
byte form = ...;
...
try{
switch(form){
case FORM_DATE: "do something"
break;
default: throw new IllegalArgumentException( "Invalid form = " + form );
}
}
---
There is no Knowledge that is not power
---