Let's say we have a class Foo:
Class Foo {
int getIntValue() throws Exception {
return 4;
}
}
and a class Bah:
Class Bah {
Bah (int i) {}
}
What if we add a Foo object to the bench "foo1", and then try to add a
Bah object to the bench using "foo1.getIntValue()" as a parameter in the
constructor? Java would say we need to catch that exception somewhere,
but where?
I tried this in BlueJ... Everything succeeded, and I wasn't alerted to
the uncaught Exception. I recorded a Unit test, which succeeded;
however, when I opened the unit test and tried to compile it, it failed.
Liam
|