The only difference is that non-static classes by default hold a reference to the parent object. But if they never use the parent object, there is no need for holding the reference, and it is then more efficient to declare them static. Static class /instances/ (the objects) are completely thread safe etc. Toplevel classes are static too, though we don't define them like that.
The only difference is that non-static classes by default hold a
reference to the parent object. But if they never use the parent
object, there is no need for holding the reference, and it is then
more efficient to declare them static. Static class /instances/ (the
objects) are completely thread safe etc. Toplevel classes are static
too, though we don't define them like that.

There's a short article about this here:
http://www.javaworld.com/javaworld/javaqa/2001-08/01-qa-0817-static.html
, and there is a seperate sub chapter in Effective Java too.


git-svn-id: ac804e38dcddf5e42ac850d29d9218b7df6087b7@457628 13f79535-47bb-0310-9956-ffa450edef68

klopfdreh/wicket,mosoft521/wicket,selckin/wicket,bitstorm/wicket,aldaris/wicket,topicusonderwijs/wicket,klopfdreh/wicket,martin-g/wicket-osgi,aldaris/wicket,dashorst/wicket,bitstorm/wicket,bitstorm/wicket,Servoy/wicket,topicusonderwijs/wicket,Servoy/wicket,Servoy/wicket,apache/wicket,selckin/wicket,bitstorm/wicket,astrapi69/wicket,mafulafunk/wicket,AlienQueen/wicket,apache/wicket,Servoy/wicket,freiheit-com/wicket,astrapi69/wicket,zwsong/wicket,mafulafunk/wicket,martin-g/wicket-osgi,dashorst/wicket,apache/wicket,freiheit-com/wicket,selckin/wicket,mosoft521/wicket,topicusonderwijs/wicket,selckin/wicket,klopfdreh/wicket,freiheit-com/wicket,aldaris/wicket,AlienQueen/wicket,selckin/wicket,dashorst/wicket,zwsong/wicket,dashorst/wicket,freiheit-com/wicket,apache/wicket,topicusonderwijs/wicket,zwsong/wicket,AlienQueen/wicket,aldaris/wicket,klopfdreh/wicket,klopfdreh/wicket,bitstorm/wicket,apache/wicket,mafulafunk/wicket,AlienQueen/wicket,zwsong/wicket,topicusonderwijs/wicket,dashorst/wicket,AlienQueen/wicket,astrapi69/wicket,mosoft521/wicket,martin-g/wicket-osgi,Servoy/wicket,aldaris/wicket,mosoft521/wicket,astrapi69/wicket,mosoft521/wicket,freiheit-com/wicket