What are Locally caught Exceptions in Java?
Whats the dofference between the ones that are caught locally and ones that are not caught locally??

hmmm to be honest i havent heard of that and had a look on google and nothing popped up. but from what i can gather i think locally caught exceptions are those that are caught within the class itsself, and global would be when the class or object is throwing an exception you have to catch? i might be wrong but to illustrate:

    class X {
    private method1() throws Exception {
    //does an operation that throws an exception
    }
    }
    public class A {
    public static void main(String[] args) {
    X x=new X();
    try {//this is a 'globally' caught exception
    x.method1();
    } catch(Exception ex) {
    ex.printStackTrace();
    }
    }
    }

and a locally caight exception would be:

 class X {
    private method1() {
    try {//this is a locally caught exception
    //does an operation that throws an exception
    } catch(Exception ex) {
    ex.printStackTrace();
    }
    }
    }
    public class A {
    public static void main(String[] args) {
    X x=new X();
    x.method1();

    }
    }

as i said i stand corrected. but as for what is local exceptions there isnt such a thing as far as my knowledge extends

class X {
private method1() throws Exception {
//does an operation that throws an exception
}
}
public class A {
public static void main(String[] args) {
X x=new X();
try {//this is a 'globally' caught exception
x.method1();
} catch(Exception ex) {
ex.printStackTrace();
}
}
}
very nice .I like it

:)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.