This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Exception Handing Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Reply locked New topic
Author

Exception Handing

Ma JianHui
Greenhorn

Joined: Mar 01, 2008
Posts: 6
public class Plane {
static String s = "-";

public static void main(String[] args) {
new Plane().s1();
System.out.println(s);
}

void s1() {
try{
s2();
}catch(Exception e) {
s +="c";
}
}

void s2()throws Exception {
s3(); s +="2";
s3(); s +="2b";
}

void s3() throws Exception {
throw new Exception();
}

}


The output is : "-c",what is going on?
Please help me!Thanks!
Anubhav Anand
Ranch Hand

Joined: May 18, 2007
Posts: 341

Please avoid posting the same query more than once as it wastes time.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Exception Handing
 
Similar Threads
Exception Handing
Exception Handing
K&S chapter 3 q-6
Exception
exception question from kb