Class Y also overrides the toString method, which is inherited from the Object class. The instance variable and the overridden toString method will be accessed later