/** * This class represents a BMX bicycle. */ public final class BMXBike extends GenericBike { public BMXBike() { super.setBikeSpeed(super.ONE_SPEED); super.setWheelSize(20); } public int getRotationalSpeed() { System.out.println( "BMX Bike - Rotational Speed" ); /* This method might be calculated by taking into consideration the terrain the weight of the ride, the force the rider is excerting on the pedals, and the friction the terrain causes on the tires. For simplicity sake, I'll just return 36 mph here. */ return 15; } /** * Inner class definition * public class Tire { private int diameter; public int getDiameter() { return diameter; } public void setDiameter(int dia) { diameter = dia; } } public Tire getTire() { Tire tire = new Tire(); return tire; }*/ /** * Anonymous inner class */ public Object getTire() { return new Object() { private int diameter; public int getDiameter() { return diameter; } public void setDiameter(int dia) { diameter = dia; } }; } }