This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman 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

Win a copy of Building Microservices this week in the Design forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Forward reference" Watch "Forward reference" New topic

Forward reference

Michael Angstadt
Ranch Hand

Joined: Jun 17, 2009
Posts: 276


Henry Wong

Joined: Sep 28, 2004
Posts: 20057

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.


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

Joined: Jun 17, 2009
Posts: 276

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: 14961

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: 802

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
Have you checked out Aspose?
subject: Forward reference
It's not a secret anymore!