public class Ex8n4 { private static void compareCars (Car firstCar, Car secondCar) { System.out.println (); int res = Car.compare (firstCar, secondCar); System.out.print (firstCar + " is "); switch (res) { case -1 : System.out.print ("less powerful than"); break; case 1 : System.out.print ("more powerful than"); break; case 0 : System.out.print ("as powerful as"); } System.out.println (" " + secondCar); } public static void main (String[] args) throws Exception { Car aCar = new Car (Car.BENFORD, "Hawkeye", 999); Car bCar = new Car (Car.PRINZ, "Supreme",1300); compareCars (aCar, bCar); compareCars (bCar, aCar); compareCars (aCar, aCar); } } // end of class Ex8n4