public class Example {
static int c = 3;
public static void main(
String [] args) {
System.out.print("Kristin wants ");
try {
System.out.print("a bike, ");
if(c > 0) {
throw new Exception();
}
System.out.print("a robot, ");
}
catch (Exception e) {
System.out.print("a dollhouse, ");
System.exit(0);
}
finally {
System.out.print("and an American Girl doll.");
}
}
}
In the above code ...finally block is not executed. Can anyone explain why??
o/p is �Kristin wants a bike, a dollhouse,� then the program exits.