ComparePlayers

ComparePlayers - player1.readPlayer(); //Prompt for and...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
// ********************************************************** // ComparePlayers // // Reads in two Player objects and tells whether they represent // the same player. // ********************************************************** public class ComparePlayers { public static void main(String[] args) { Player player1 = new Player(); Player player2 = new Player(); //Prompt for and read in information for player 1 System.out.println("Enter information for player 1");
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: player1.readPlayer(); //Prompt for and read in information for player 2 System.out.println("Enter information for player 2"); player2.readPlayer(); //Compare player1 to player 2 and print a message saying //whether they are equal if (player1.equals(player2)) System.out.println("They are the same player."); else System.out.println("They are different players."); } }...
View Full Document

This note was uploaded on 03/22/2010 for the course CS 202 taught by Professor Fong during the Spring '10 term at SIU Carbondale.

Ask a homework question - tutors are online