how do i get/handle exceptions in a static block?
static{
try{
Test a =new Test();
test.getResult();
}
catch (Exception e){
...
}
}
assuming getResult will result to a NullPointerException, how can i get the error msg like for example i want to log that error?
[563 byte] By [
kneelmara] at [2007-11-27 8:12:58]

static blocks can't throw Exceptions so if you do encounter one the only thing you can do is handle it and set the class up in a way that indicates to methods that the static initialiser failed (and log things of course).
Those methods can then throw their own Exception to indicate that failure.