|
-
Jul 11th, 2001, 01:58 PM
#1
Thread Starter
Dazed Member
flow controll help!!!
Im taking the Java 2 progammer test in two weeks and one of my weakest points is program flow. Where one has to figure out a small programs output.
Im a little confused buy this program. The output is supposed to be 4 and 5 but i dont see it at all. If someone could please tell me how they are getting this it would be great.
class Question{
public class void main(String[] args){
for(int i = 0; i <10; ++i){
try{
try {
if(i % 3 == 0) throw new Exception("E0");
System.out.println(i);
}catch (Exception inner){
i *= 2;
if(i % 3 == 0) throw new Exception("E1");
}finally{
++i;
}
}catch (Exception outer) {
i += 3;
}finally{
--i
}
}
}
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|