File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
A friendly place for programming greenhorns!
Big Moose Saloon
Search
|
Java FAQ
|
Recent Topics
Register / Login
JavaRanch
»
Java Forums
»
Java
»
Servlets
Author
Exception Handing
Ma JianHui
Greenhorn
Joined: Mar 01, 2008
Posts: 6
posted
Mar 04, 2008 23:21:00
0
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
I like...
posted
Mar 04, 2008 23:37:00
0
"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.
I agree. Here's the link:
http://zeroturnaround.com/jrebel/download
subject: Exception Handing
Similar Threads
K&S chapter 3 q-6
Exception Handing
exception question from kb
Exception
Exception Handing
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter