Added a method to print a string which includes their value for name.