Meaningless Drivel is fun!
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 REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Reply locked New topic

Exception Handing

Ma JianHui

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

public static void main(String[] args) {
new Plane().s1();

void s1() {
}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.
I agree. Here's the link:
subject: Exception Handing
jQuery in Action, 3rd edition