I was reading an example about final
for Java, and saw something like this:
Counter c = new Counter()
{
public int count() {
super.count();
return super.count();
}
}
c.count(); // now count 2
Is there a name for such construct? Is this ever used in practice? Is yes, it is considered a good OOD? A reference or a blog article would be appreciated.