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

Michael Angstadt
Ranch Hand

Joined: Jun 17, 2009
Posts: 273

YES THIS MAKES TOTAL SENSE. GO SUN.


SCJP 6 || SCWCD 5
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18875
    
  40

Michael Angstadt wrote:YES THIS MAKES TOTAL SENSE. GO SUN.


Yea. The compiler is not very good in this regard. It can be tricked easily by using a reference.

Henry


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
Michael Angstadt
Ranch Hand

Joined: Jun 17, 2009
Posts: 273

It just seems like it would make more sense just to not allow a field to be used at all until it is declared. But who knows.
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14194
    
  20

The Java programming language was originally designed to be appealing to C++ programmers, and so it inherited large parts of its syntax and semantics from C++, where it probably works in a similar way.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
Ninad Kulkarni
Ranch Hand

Joined: Aug 31, 2007
Posts: 791

Hi Michael,
You can find forward reference in JLS. See JLS


SCJP 5.0 - JavaRanch FAQ - Java Beginners FAQ - SCJP FAQ - SCJP Mock Tests - Tutorial - JavaSE7 - JavaEE6 -Generics FAQ - JLS - JVM Spec - Java FAQs - Smart Questions
 
GeeCON Prague 2014
 
subject: Forward reference