OOhh okay. That makes sense. Thank you! I will work at it.
Type: Posts; User: iDizzle
OOhh okay. That makes sense. Thank you! I will work at it.
Ok Thank you. For Step 7 I believe the output should be cleared up later on in the instructions since there are 12 steps to the assignment. If not than I will create a "get" method.
So for Step 8...
Hi everyone, I'm working on a roulette game and am a pretty confused. I have a sheet with instructions on what to do with 2 classes and the main program which were provided in 3 files. I'm stuck on...
Than how can I reference the toString?
Nope. No errors in the class itself or the toString method. I only get an error when I try to use System.out.println(faceName); or System.out.println(face); or however else I try to call the toString.
public String toString()
{
String faceName;
if (face == HEADS)
faceName = "Heads";
else
faceName = "Tails";
return faceName;
}
}
Thanks for chiming in Norm. When I try "System.out.println(faceName);" the compiler still says that "faceName cannot be resolved to a variable".
So based on the first code above(the Coin class), would I do something like "System.out.println(faceName);" ? Or how would I get the program to return the value in the toString method in the Coin...
Hi everyone. I'm writing a program that is using a class called Coin.java, that flips a coin. The program is supposed to find the longest run of Heads in 100 flips of the coin. I'm having trouble...
Will do, thank you! Yeah because I did not know where the problem was coming from. As long as I know its a syntax error than I know where to being. Thanks again! I'll see how it works out afterwards.
Sorry, this is all just so confusing to me. My text book is very vague about this. I understand the concept of creating and using a class but I'm just having trouble putting it into use. Thanks for...
As far as I know, these are the error messages that it's giving me. These error messages are from the boosterSales program that I'm trying to use the bandBooster class methods and variables from. No...
ohh ok. Well, both of the files are in the same folder. They are both in the "bin" folder and both in the "src" folder.
So I guess my question is, in order to use the methods and variables from a class(bandBooster) that I've created, in the new program(boosterSales) do I have to open both files at the same time? Or do...
Sorry, how do I use the java command? I'm a beginner =[
My compiler has little "x"s at the beginning of the line to annotate errors and for example, line 6 says;
----------------------------------------------------------------------
Joe cannot be...
This is the error that I get.
Exception in thread "main" java.lang.Error: Unresolved compilation problems:
name cannot be resolved to a type
name cannot be resolved to a type
Duplicate...
This is the error that I get.
Exception in thread "main" java.lang.Error: Unresolved compilation problems:
name cannot be resolved to a type
name cannot be resolved to a type
Duplicate...
Hi guys. So I updated the first post with more of what I'm trying to do. For an assignment I need to create a class and write another program using methods from that class. When I try to use them...
Pb, by his (a) being in the wrong place do you mean that his int variables should be declared at the very beginning of the main? Pb, you know that I am no java expert but it does look odd to me....
Hi pb. Do you mean if you drag the window and resize it, it will recreate the random circles? Because it does do that.
Hmmm. It's possible. I wouldn't know though, sorry =/. I use Eclipse to run this stuff.
Hmmm. Take a look at my code above and see if you can make anything out of it.
Sorry, this may not be much help since I am still a beginner but where are you int declarations for startX,Y and circleRad? Other than that, I only see one instance of a circle being drawn so I'm not...
Ah, thank you! That looks much better. So to add a main I would add it below all of that code above? What did you mean by the main() will create an instance of the class? Sorry, I'm a beginner...