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 functionstheir analogs of methodsbefore you use those functions.