Any valid Java expression can be substituted for the string "Java rules!" in the class Motto above. The resulting program will print the value of the specified expression. For example, the program
prints the textclass Motto { public static void main(String[] args) { System.out.println("98 F = " + (98.-32.)*(5./9.) + " C"); } }
(converting Fahrenheit to centigrade). The static method System.out.println takes a single argument and prints it. You can print the value of more than one expression on a line by constructing the desired String using the String concatenation operator +. This operator coerces any value that is not a String to a String suitable for printing.98 F = 36.66666666666667 C
Finger Exercise: Modify the Motto class from the previous
finger exercise to convert your favorite Fahrenheit temperature f to centigrade using the formula