aspose file tools
The moose likes Servlets and the fly likes Exception Handing Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Exception Handing" Watch "Exception Handing" 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!Thank you!
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

"king king",
Welcome to the JavaRanch.

We're a friendly group, but we do require members to have valid display names.

Display names must be two words: your first name, a space, then your last name. Fictitious names are not allowed.

Please edit your profile and correct your display name since accounts with invalid display names get deleted.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Exception Handing