Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Java in General and the fly likes Static initaializer block & forward referencing -Question from SCJP 6 book by Khalid Mughal Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "Static initaializer block & forward referencing -Question from SCJP 6 book by Khalid Mughal" Watch "Static initaializer block & forward referencing -Question from SCJP 6 book by Khalid Mughal" New topic
Author

Static initaializer block & forward referencing -Question from SCJP 6 book by Khalid Mughal

Lucky J Verma
Ranch Hand

Joined: Apr 11, 2007
Posts: 277
I have a question on static initializer block and forward referencing from khalid mughal scjp 6 book -page 411/ch 9 topic 9.9
It says in static initializer block too -follows declaration -before-use rule



As per this following example should fail .....One variable sf1 is declared ,defined and use in difference static blocks and not in order of declration-then define-then use.

Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19216

Please use code tags.


SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
 
I agree. Here's the link: http://jrebel.com/download
 
subject: Static initaializer block & forward referencing -Question from SCJP 6 book by Khalid Mughal
 
Similar Threads
Static Initializer Code
Initializer block problem ....'Illegal forward reference'
Static Initializer Blocks
Static Initializer Block
initialization