This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes On Forward Reference Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "On Forward Reference" Watch "On Forward Reference" New topic
Author

On Forward Reference

Karthik Balasubramanian
Ranch Hand

Joined: Dec 13, 2002
Posts: 43
Hi,
I am appearing for SCJP 2 1.4 Exam tomorrow. I do not have a good understanding on "Forward Reference on variables and methods".Can some one please explain me very brief.
Karthik
James Hook
Greenhorn

Joined: Jan 20, 2003
Posts: 18
the term 'forward reference' applies to using a method or variable before it has been declared. In c\c++, the compiler has to know the prototype of the method before it is used but Java is not so demanding.
The rules are:
Method Variables - you must declare and initialize a method variable before it is used
Class/Instance Variables/Methods - can be used in the source code file before they have been declared. The Java compiler will probably already know about these methods form a previous sweep through the file.
Good luck with your exam (if you haven't already taken it)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: On Forward Reference
 
Similar Threads
regarding forward referencing and 'implicit narrowing conversion'
compiler error
Static block compilation
forward reference doubt
Static