Link to home
Create AccountLog in
Avatar of Rohit Bajaj
Rohit BajajFlag for India

asked on

Usage of static and non static member class

HI,
Following is a portion from Effective java on why one should always prefer to use static inner classes over non static -
User generated imageIt seems contradicttory.. The first thing is that Each instance of the non static class will contain an extraneous reference to the outer class ??
As one cannot instantiate the inner class without instantiating the outer class. The outer class instance will always be there..
How its gonna be an extra thing....
Please suggest some pros and cons of using static member classes..

Thanks
ASKER CERTIFIED SOLUTION
Avatar of Jan Louwerens
Jan Louwerens
Flag of United States of America image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account