Monday, July 18, 2011

Finally in java : case

public class FinallyExample1 {

public static void main(String[] args) {
System.out.println((new FinallyExample1 ()).test());
}

public int test() {
try {
return 1;
} finally {
return 0;
}
}
}

'Finally' can be written to override the return values.

No comments:

Post a Comment