I just found this code that I thought was humorous (identifiers changed to protect
intellectualproperty):
private boolean allFoosAreBarsOrBazs() {
for (Foo foo: foos) {
if (!(foo instanceof Bar)) {
if (!(foo instanceof Baz)) {
return false;
}
}
if (!(foo instanceof Baz)) {
if (!(foo instanceof Bar)) {
return false;
}
}
}
return true;
}
Comments
Post a Comment
You can use some HTML tags, such as <b>, <i>, and <a>.