Java Inner Classes Design Benifits -


in java, can have inner classes. i'm curious design perspective if there benefits this.

my initial thoughts having separate file class cleaner in separating things reusable modules. doing so, if other classes wish use other class, can make own instances. me seems avoiding inner classes may better design extensibility , code reuse, , when working on new projects, hard tell if class reused or not... feel siding on having separate classes way go.

i ask question because took on project has bunch of these... makes me think previous developer may of been lazy or unfamiliar ide. want make sure i'm not missing benefits these inner classes have. if there benefits can let me know, , can confirm if previous developer taking advantage of these benefits.

inner classes when not used outside containing class - it's way of curtailing class bloat. general rule, that's time use them.

non-static inner classes have access containing instance's private fields.


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -