/* package whatever; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
private static class CustomException
extends Exception { }
{
try
{
System.
out.
println("Calling nocatch(false)"); nocatch(false);
}
catch (CustomException ce) {
System.
out.
println("Caught CustomException for false case"); }
try
{
System.
out.
println("Calling nocatch(true)"); nocatch(true);
}
catch (CustomException ce) {
System.
out.
println("Caught CustomException for true case"); }
}
public static void nocatch(boolean foo) throws CustomException
{
try
{
if (foo) {
System.
out.
println("Throwing"); throw new CustomException();
}
}
finally
{
System.
out.
println("In finally"); }
System.
out.
println("Reached outside the try/finally block"); }
}
LyogcGFja2FnZSB3aGF0ZXZlcjsgLy8gZG9uJ3QgcGxhY2UgcGFja2FnZSBuYW1lISAqLwoKaW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CgovKiBOYW1lIG9mIHRoZSBjbGFzcyBoYXMgdG8gYmUgIk1haW4iIG9ubHkgaWYgdGhlIGNsYXNzIGlzIHB1YmxpYy4gKi8KY2xhc3MgSWRlb25lCnsKCXByaXZhdGUgc3RhdGljIGNsYXNzIEN1c3RvbUV4Y2VwdGlvbiBleHRlbmRzIEV4Y2VwdGlvbiB7Cgl9CglwdWJsaWMgc3RhdGljIHZvaWQgbWFpbiAoU3RyaW5nW10gYXJncykgdGhyb3dzIGphdmEubGFuZy5FeGNlcHRpb24KCXsKCQl0cnkKCQl7CgkJCVN5c3RlbS5vdXQucHJpbnRsbigiQ2FsbGluZyBub2NhdGNoKGZhbHNlKSIpOwoJCQlub2NhdGNoKGZhbHNlKTsKCQl9CgkJY2F0Y2ggKEN1c3RvbUV4Y2VwdGlvbiBjZSkgewoJCQlTeXN0ZW0ub3V0LnByaW50bG4oIkNhdWdodCBDdXN0b21FeGNlcHRpb24gZm9yIGZhbHNlIGNhc2UiKTsKCQl9CgkJdHJ5CgkJewoJCQlTeXN0ZW0ub3V0LnBya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