Search:

Type: Posts; User: SilentNite17

Search: Search took 0.09 seconds.

  1. Re: Beginner for Java, need help with this code I wrote

    Thanks.

    -Silent
  2. Re: Beginner for Java, need help with this code I wrote

    Hmmm.......

    Alright, I just don't know who to ask.
  3. Re: Beginner for Java, need help with this code I wrote

    Oh....

    Well, it was already defined as Cards, see:



    public class Cards {

    enum Suits { Club, Diamond, Spade, Heart }
  4. Re: Beginner for Java, need help with this code I wrote

    Really, I'm sorry, I don't know what your talking about.

    All I do when I run the program in Elipse to check to see if there are any errors is I click the run button.

    Hmmmmmm.......

    Can...
  5. Re: Beginner for Java, need help with this code I wrote

    If I ran it in the console (cmd), it would be javac to compile and java to run it. If I run it in Eclipse, I suppose i just click the run button.

    Is this what you've been asking?
  6. Re: Beginner for Java, need help with this code I wrote

    Thank you, Norm, that solved the switch problem, but when I run the code in Eclipse, it still gives the main() error.
  7. Re: Beginner for Java, need help with this code I wrote

    Yes, I tried that. When I switch the (double) to an (int), then it says the same thing and when I switch it to a string it says

    The operator * is undefined for the argument type(s) String, double...
  8. Re: Beginner for Java, need help with this code I wrote

    Ok, thanks, that solved the default problem, but now we still have the same error as before and a new problem earlier in the switch:


    switch ( (double) 3*Math.random() ) {

    The (double)...
  9. Re: Beginner for Java, need help with this code I wrote

    Yes, that's what 've been saying.

    The problem is that's all it says. All it tells me is that error code.

    Also, it gets an error with the case default in the switch.

    I have the feeling we...
  10. Re: Beginner for Java, need help with this code I wrote

    Alright, here:


    public class Cards {

    enum Suits { Club, Diamond, Spade, Heart }

    public static void main(String[] args) {

    String userInp;
  11. Re: Beginner for Java, need help with this code I wrote

    Ummm.......

    Why? I already know how to write AND execute a program. I have written quite a few, even. That work.

    If you could elaborate on what SPECIFICALLY the computer means by

    Error:...
  12. Re: Beginner for Java, need help with this code I wrote

    Alright......

    When I was reading the doc, the sample problem was this:

    String computerMove;
    switch ( (int)(3*Math.random()) ) {
    case 0:
    computerMove = "Rock";
    break;
    case...
  13. Re: Beginner for Java, need help with this code I wrote

    OK, new problem with same (or similair) code.

    I re wrote the code in my previous post with the java.util.Scanner, and here is what it looks like:

    import java.util.Scanner;


    public class...
  14. Re: Beginner for Java, need help with this code I wrote

    Sorry, Norm. Thank you form reminding me.

    Disregard the part about input, I have learned how to use a Scanner now. The errors that I am getting are things like "cannot convert to double" or...
  15. Beginner for Java, need help with this code I wrote

    Hey,

    I'm new to Java and this forum. I have been reading the online book JavaNotes to learn Java, and I wrote this code. I couldn't figure out what was wrong with it using the book, except for...
Results 1 to 15 of 15