2 Answers. 2. Your toString() method prints the name of the class of the object: return getClass().getName(); The object is an instance of Card , so its class is Card.class , whose name is Card . You want to print the value of the name field.9 Şub 2014