This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Forward reference 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 reference" Watch "Forward reference" New topic
Author

Forward reference

Rastogi Manish
Greenhorn

Joined: Dec 11, 2006
Posts: 5
Can some body help me below code. It compile properly but it givec compile time error when I comment out SOP with reason illegal forward reference.



Thanks & Regards
Manish Rastogi
Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9398
    
    2

You are trying to use the variable a before it is declared. The forward referencing rule says that you cannot use a variable on the right hand side of an assignment statement or use it to print something before it can be declared.

Hope this helps.


SCJP 1.4, SCWCD 1.4 - Hints for you, Certified Scrum Master
Did a rm -R / to find out that I lost my entire Linux installation!
Rastogi Manish
Greenhorn

Joined: Dec 11, 2006
Posts: 5
Ok Thanks Sankararaj

Regards,
Manish Rastogi
 
Don't get me started about those stupid light bulbs.
 
subject: Forward reference