Project: Add a Method to Your Class

Add a method to your class and call it to display object data.

We'll cover the following

Add a method display() inside Player that prints the player’s name and score. Then call p1.display() and p2.display() in main().

Get hands-on with 1400+ tech skills courses.