This is an example from a book to explain using the WhoWins type for three possibilities.
But when I go to compile, I get the error, "cannot find symbol - class WhoWins". Any suggestions? Thanks

import java.util.Scanner;
import static java.lang.System.out;

class Scoreboard {

public static void main(String args[]) {
Scanner myScanner = new Scanner(System.in);
int hankees, socks;
WhoWins who;

out.print("Hankees and Socks scores? ");
hankees = myScanner.nextInt();
socks = myScanner.nextInt();
out.println();

if (hankees > socks) {
who = WhoWins.home;
out.println("The Hankees win :-)");
} else if (socks > hankees) {
who = WhoWins.visitor;
out.println("The Socks win :-(");
} else {
who = WhoWins.neither;
out.println("It’s a tie :-|");
}

out.println();
out.println("Today’s game is brought to you by");
out.println("SnitSoft, the number one software");
out.println("vendor in the Hankeeville area.");
out.println("SnitSoft is featured proudly in");
out.println("Chapter 6. And remember, four out");
out.println("of five doctors recommend SnitSoft");
out.println("to their patients.");
out.println();

if (who == WhoWins.home) {
out.println("We beat ‘em good. Didn’t we?");
}
if (who == WhoWins.visitor) {
out.println("The umpire made an unfair call.");
}
if (who == WhoWins.neither) {
out.println("The game goes into overtime.");
}
}
}

Well, you will need that class... It's not going to appear out of thin air, so you will have to write it (though I presume this is part of some example, which means it will be there somewhere else in the example).

Ok, I'll just read on then, it'll probably come back to it later.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.