July 8, 2009
June 8, 2009
May 16, 2009
Java Traps: return in a finally clause
The following code does not throw RuntimeException -- it is lost....
public class MainApp {
public static void main(String[] args) {
try {
produceRuntimeException();
System.out.println("yikes!!!");
} catch (Exception ex) {
System.err.println("Got it!" );
}
}
private static void produceRuntimeException() {
try {
throw new RuntimeException();
} finally {
return;
}
}
}
May 1, 2009
April 3, 2009
March 28, 2009
March 18, 2009
March 10, 2009
March 5, 2009
March 4, 2009
February 27, 2009
February 25, 2009
February 24, 2009
January 5, 2009
Hello, world
private Object theGodKillsKittenEveryTimeYouUseThisVariable;
...
public Object getTheGodKillsKittenEveryTimeYouUseThisVariable(){
Object killedKitten=theGodKillsKittenEveryTimeYouUseThisVariable;
return killedKitten;
}
Subscribe to:
Posts (Atom)