Name: Anonymous 2007-04-28 19:19 ID:r3l/lAht
Okay guys... I have a char[] suposely made of A's, B's and C's...
If I find a character that isn't one of those, I want it to throw an exception and leave.
how do I do it?
char[] zong = {A,L,C,B,}
for (int k = 0; k < zong.length; k++ ) {
if ((zong[k] != A) && (zong[k] != B) && (zong[k] != C)) {
throw new Exception("exit");
}
}
Is this it?
thanks, /prog/
If I find a character that isn't one of those, I want it to throw an exception and leave.
how do I do it?
char[] zong = {A,L,C,B,}
for (int k = 0; k < zong.length; k++ ) {
if ((zong[k] != A) && (zong[k] != B) && (zong[k] != C)) {
throw new Exception("exit");
}
}
Is this it?
thanks, /prog/