Skipping down to the next 'else'
Hello,
I am wondering, as a conventience method, if there is any way to skip down to the next 'else' in an if-else block. For instance, I want to be able to write a code in the following way:
if (A exists){
int B = A.complexProcess();
int C = B.complexProcess();
if (C is not valid)
// *** skip down to the next else
int D = C.complexProcess();
}else{
do somethingelse
}
Now, granted I could write it as
int C = 0;
boolean CisValid =false;
if (A exists){
int B = A.complexProcess();
C = B.complexProcess();
if (C is valid)
CisValid =true;
}
if (CisValid){
int D = C.complexProcess();
}else{
do somethingelse
}
however, this seems to be rather more complicated.
Soo.... is there a way to do the first version?
Thanks!
Sam

