Home Segments Top Top Previous Next

109: Sidetrip

The Java compiler does not require Java programs to be ordered such that each method's definition appears before calls to that method appear. Thus, movieRating does not need to be defined before main is defined, just because main contains a call to movieRating.

In this respect, Java is much easier to work with than is C or C++, both of which require that you define functions—their analogs of methods—before you use those functions.