/* * Convert.class prints a short table of common conversion factors */ class Convert { /* * Note that the main method must be be defined as * public static void main (String []) to be called from * the Java interpreter. */ public static void main (String args[]) { double mi_to_km = 1.609; double gals_to_l = 3.79; double kg_to_lbs = 2.2; System.out.print ("1 Mile equals\t"); // No newline at end here System.out.print (mi_to_km); System.out.println ("\tKilometers"); // Print new line at end System.out.print ("1 Gallon equals\t"); System.out.print (gals_to_l); System.out.print ("\tLiters\n"); // \n works as new line also System.out.print ("1 Kilogram equals\t"); System.out.print (kg_to_lbs); System.out.println ("\tPounds"); } }