IBM i5/iSeries Primer(c) Concepts and Techniques for Programmers, Administrators, and Sys[... ]ators

Figure 26.10 shows the source code for a Java application that receives in a numeric value, performs some arithmetic against the value and prints the result:

JAVA doMath 9

Figure 26.10: Java application using Arithmetic.

This line of code invokes the doMath Java application and passes it a single argument of 9. The application prints the following values:

It is important to note that, in this example, a Floating point class instance named F was used rather than a floating point variable. Either would work: It's primarily a matter of preference.

Категории