Avatar of Rohit Bajaj
Rohit Bajaj
Flag 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 -
Screen-Shot-2018-02-01-at-10.40.52-P.pngIt 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
Java

Avatar of undefined
Last Comment
Jan Louwerens

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Jan Louwerens

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Your help has saved me hundreds of hours of internet surfing.
fblack61