Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

static inner class constructor

 
Gary Kevin
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

it compiles well,if i write a constructor for class BigOuter like this:



it still compiles well,I can't use the constructor like this:

why?
 
Mintoo kumar
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
try to explore on static (which related to class not an object).
And remove static from inner class then check the code.
i am sure you will get difference and answer itself.

______________
Mintoo
SCJP 1.4
_____________
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

i think this will help you

-------------------------------
BigOuter.Nest n = new Nest();
n.go();
--------------------------------

thanks & regards,
seetharaman.v
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic