Andy Josh wrote:I've been wondering for a while what the difference between a static inner class and a normal class is.
Very little, except for what you've obviously discovered.
Why would I ever want to use InnerClass if I can use FakeInnerClass?
Basically: what Campbell said.
There's also an advantage to that proximity in that you generally don't have to repeat as much - for example, documentation.
Personally, I also rather like the structured names that result:
Map.Entry makes much more sense to me than
MapEntry - or it would if
Entry was actually defined in
Map.
And that brings up another point: You can define
static classes in an
interface - and TBH, I don't know why it isn't done more often:
makes much more sense to me than having a
separate AbstractList class.
But maybe it's just me.
Winston