Example of using anonymous fields to simulate inheritance and polymorphism