GeeCON Prague 2014*
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


JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "forward references and declaration order" Watch "forward references and declaration order" New topic
Author

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....


SCJP1.6,SCWCD1.5
Siva Masilamani
Ranch Hand

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

but this may help you

webpage


SCJP 6,SCWCD 5,SCBCD 5

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
Hello,

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,

Prithvi,
My Blog, Follow me on Twitter,Scjp Tips, When you score low in mocks, Generics,Scjp Notes, JavaStudyGroup
 
GeeCON Prague 2014
 
subject: forward references and declaration order