jQuery in Action, 3rd edition
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes forward references and declaration order Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "forward references and declaration order" Watch "forward references and declaration order" New topic

forward references and declaration order

narendra bhattacharya
Ranch Hand

Joined: Feb 17, 2010
Posts: 66
khalid mughal book page no. 407

Can anyone explain this

There is one caveat to the declaration -before-reading rule.: "it does not apply if the initializer expression defines an anonymous class ,as the usage then occur in a different class with its own accessibility rules in the enclosing context....

Siva Masilamani
Ranch Hand

Joined: Sep 19, 2008
Posts: 385
I did not gor thorugh that book

but this may help you



Failure is not an option.
narendra bhattacharya
Ranch Hand

Joined: Feb 17, 2010
Posts: 66
thank you Siva you have given me a good link that made my concept clear....than you..
Prithvi Sehgal
Ranch Hand

Joined: Oct 13, 2009
Posts: 774

You must look at this excellent article
as well. Look into ยง8.3.2.3 Restrictions on the use of Fields during Initialization of JLS as well as pointed by this article.
An excellent article written by Corey.

Hope this helps,

My Blog, Follow me on Twitter,Scjp Tips, When you score low in mocks, Generics,Scjp Notes, JavaStudyGroup
I agree. Here's the link: http://aspose.com/file-tools
subject: forward references and declaration order
It's not a secret anymore!