// Filename: Temperature.java
/* Identifiers and keywords in Java are case-sensitive. Therefore, the
case of the file name must match the class name, the keywords must
all be written in lowercase. The name of the String class has a
capital S. The main method must be static and take an array of
String objects as an argument. */
public class Temperature {
public static void main(String[] args) { // Correct method signature
double fahrenheit = 62.5;
// /* identifies the start of a "starred" comment.
// */ identifies the end.
/* Convert */
double celsius = f2c(fahrenheit);
// '' delimits character literals, "" delimits string literals
System.out.println(fahrenheit + "F = " + celsius + "C");
}
static double f2c(double fahr) { // Note parameter type
return (fahr - 32) * 5 / 9;
}
}