J
JavaNovice
Hi All,
I am new to this group and new to Java. Currently i am only six weeks
into a course. I am studying bioinformatics. Anyway i am working my way
through Java for dummies along side the coursework i am being set but i
have come to a roadblock.
I am trying to run the following code:-
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 Hankeevilee 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. Didin'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.");
}
}
}
But the compiler cannot find WhoWins enum type. I have installed the
latest jdk-6-beta2 with the relevent API documents and still no joy. I
was using jdk-1_5 with relevent API. I can just skip enum types but i
would rather get to the bottom of this. Also, i went onto Java sun
tutorials and copied and pasted their example of the enum type Day in a
piece of code into my complier. Again the same problen ; cannot find
symbol class Day. Help please i have exhausted all possibilities and i
am now just left scratching my very sore head.
Thanks
Sarah
xx
I am new to this group and new to Java. Currently i am only six weeks
into a course. I am studying bioinformatics. Anyway i am working my way
through Java for dummies along side the coursework i am being set but i
have come to a roadblock.
I am trying to run the following code:-
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 Hankeevilee 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. Didin'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.");
}
}
}
But the compiler cannot find WhoWins enum type. I have installed the
latest jdk-6-beta2 with the relevent API documents and still no joy. I
was using jdk-1_5 with relevent API. I can just skip enum types but i
would rather get to the bottom of this. Also, i went onto Java sun
tutorials and copied and pasted their example of the enum type Day in a
piece of code into my complier. Again the same problen ; cannot find
symbol class Day. Help please i have exhausted all possibilities and i
am now just left scratching my very sore head.
Thanks
Sarah
xx