Trying to teach my self java please help!

Discussion in 'Software' started by nickmerritt56, Jan 15, 2012.

  1. nickmerritt56

    nickmerritt56

    Joined:
    Jan 15, 2012
    Messages:
    2
    I'm reading a book trying to learn how to make java programs and I type up one of the programs using eclipse and I have also tried jcreator. both are running jdk 1.7 and both have different messages but are copies of the same program... I do not understand???
    This is the program it's an attempt to help me learn the concept of enum.... some one please help!!
    On eclipse the error shows up at WhoWins Who. Using Jcreator there is no visible error until it's compiled and then it says" Error: Could not find or load main class Scoreboard"
    Thanks for any help!!!


    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.”);
    }
    }
    }
    nickmerritt56, Jan 15, 2012
    #1
    1. Advertising

  2. nickmerritt56

    nickmerritt56

    Joined:
    Jan 15, 2012
    Messages:
    2
    sorry

    I figured it out thanks anyway... it was driving me insane...
    nickmerritt56, Jan 15, 2012
    #2
    1. Advertising

  3. nickmerritt56

    Wondershare

    Joined:
    Jan 16, 2012
    Messages:
    1
    may you explain what is applet in java.
    Wondershare, Feb 7, 2012
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. lvirden@yahoo.com

    Help sought trying to add java to mozilla 1.5

    lvirden@yahoo.com, Nov 27, 2003, in forum: Firefox
    Replies:
    7
    Views:
    546
    Phil Brown
    Dec 21, 2003
  2. reynArd
    Replies:
    0
    Views:
    472
    reynArd
    Nov 20, 2004
  3. Ned
    Replies:
    1
    Views:
    402
    Doug McIntyre
    May 15, 2005
  4. Teachz555

    wtb: used PDA to help me teach

    Teachz555, Nov 16, 2003, in forum: Digital Photography
    Replies:
    1
    Views:
    507
    agent yellow
    Nov 16, 2003
  5. Tiffany Smiles

    Help Please...Teach an old dog some new tricks

    Tiffany Smiles, Dec 23, 2005, in forum: Computer Support
    Replies:
    4
    Views:
    486
Loading...

Share This Page