Win a copy of Microservices Testing (Live Project) this week in the Spring forum!

Tom Orr

Greenhorn
+ Follow
since Mar 17, 2011
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Tom Orr

is there a way to convert it from a string to my enum type? Like the wrapper classes?
11 years ago
OK got it, Here is where I am now. Why do I get an incompatible type error on lines 32 and 33. And how can I make it so it assigns the value it pulls from the string to my enum?

11 years ago
yes the compiler tells me an identifier is expected for the integers. I changed it to public and still get the same message.

Im going to try going another direction with this.

my enum will be public and contain {ACE,TWO,THREE,FOUR,FIVE,SIX,SEVEN,EIGHT,NINE,TEN,JACK,QUEEN,KING}

11 years ago
Can someone tell me why this does not work and how to fix it

private enum GuessedValue{A,2,3,4,5,6,7,8,9,J,Q,K}

I think it sees it as both integers and chars
11 years ago
I really do want to understand this stuff. Here is what I am trying now. I think I keep trying to rethink everything too much. Im not sure when I would use static and not use static. I dont understand where to put the {} brackets on a class vs a method and how a class and a method differ. Couldnt I just make a method that represents a die roll and it would work the same as a class that represented a die roll? Is the class just a seperate program that can be accessed by another program where a method could only be accessed from within a class? I am feeling so dumb and confused. This looks like it should be so simple and basic that I am just not getting some basic flow of the programming. UGH



11 years ago
Ok thanks for the help. I have made some changes and here is what I have.


11 years ago
Yes I realize I am not understanding this very well. Thanks for your help. I am hoping that things start clicking for me soon.

Here is what I have after the suggestions. Still now working as I expected. If you could point out my errors again I will keep trying.

11 years ago

I need to know how to create an object of Dice with Die1 and Die2.
would I just start with
Dice Die1 = new Dice();
Dice Die2 = new Dice();

Here is where I would need to assign the value to Die1 and Die2 for the setUpperFace and Im not sure how to do that.

11 years ago
OK so I have started over and this is what I have. I now need to know how to create an object of Dice with Die1 and Die2.
would I just start with
Dice Die1 = new Dice();
Dice Die2 = new Dice();

Here is where I would need to assign the value to Die1 and Die2 for the setUpperFace and Im not sure how to do that.


11 years ago
I am getting an error message stating I have no main when I run. It compiles OK. I have a main but it says I dont. Thanks ahead of time for any help.


11 years ago
OK I think I figured out the Enum issue. I saved my enum as a seperate .class file

Now I get an error telling me variable sMonth might not have been initialized






11 years ago
Thank you everyone for your responses. Vicky the assignment asks us to place our enum in our method. Here is what is requested.

1. Create a method for the conversion.
2. Use an enumeration to define the possible months (place in the conversion method).
3. Print an error message to the screen if the input is out of bounds.
4. Wrap the user input in a while loop. Continue looping until the user quits. Put this part in the main method and then pass the user input to the conversion method to convert from an integer to a month.


Are you saying what is requested in step 2 is not possible?

I took a basic programming class back in the 80's and I think my brain is still thinking in basic code and giving me trouble trying to grasp some of the java programming techniques.


11 years ago
I am taking a beginning Java class online and am having a little trouble creating and calling methods and including my enum in my method. Here is what I have. any pointers and tips would be greatly appreciated. I am just beginning to learn this so forgive me if I made alot of newbie errors.



11 years ago