Matt Player

Greenhorn
+ Follow
since Jan 11, 2009
Merit badge: grant badges
For More
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 Matt Player

Just to confirm my own understanding, I can't parse a primitive (e.g an "int") to another primitive type (e.g a "double") without first of all wrapping that "int" into an Integer? In fact, apart from arithmetic functions I cant do very much with an int (or any primitive) at all?

Cheers, Matt.
14 years ago
Hi there, sorry if this post is in the wrong place but would anyone be able to give me some very general info on how to embed a java file into filemaker. I am basically using it to create a scale drawing which will take arguments from fields in the filemaker file (using JPanel). It also needs to pass arguments back out of java and import them back into fields in a filemaker record. I know that this is probably a really stupid and vague question but if anyone could even point me towards some topics I could research on the tinterweb that would be great.
14 years ago

you have declared nob as an instance variable for the class. That means that each and every 'Dog' object will have an integer called 'nob'.



Can I not reference this within the method then?
15 years ago
Hi there, probably easier to give code than to explain so:



and when I try to compile this I get the error:

DogTestDrive.java:6: <identifier> expected
void bark(nob) {
^
DogTestDrive.java:26: ')' expected
}
^
2 errors
Powerbook:~/javaeg matt$ javac DogTestDrive.java
DogTestDrive.java:6: <identifier> expected
void bark(nob) {
^
DogTestDrive.java:26: ')' expected
}
^
2 errors



Now it seems to be telling me that I need to identify my variable "nob" (or number of barks... of course!) but I have already declared as a variable at the top.

Please tell me why this no work??

Cheers

Matt
15 years ago
Hi there, am kind of getting to grips with the whole (or a very, very small portion of) java thang but I have just typed in an example from my book which sounds a little like this;



and the output I get is this;

null says ruff!
last dogs name is Bart
Fred says ruff!
Marge says ruff!
Bart says ruff!



My question is, who is null and who invited him to the party?? Surely the last loop of the main body of code declares an integer, x and starts it at x=0 but myDogs[0].name = "Fred"

Any thoughts on this would be most welcome,

Cheers,

Matt.
15 years ago
Yes, this is for compiling one of the other classes.
15 years ago
Compiling through javac in terminal (in mac os x) and the error messages are as above.
15 years ago
GameLauncher.java , GuessGame.java and Player.java are all in their own files. I am trying to compile them separately but the only one I can compile succesfully is Player.java, I assume because that is the only class which is not dependent on another.

I do feel a bit out of my depth with this but I am hoping it will kind of click. For example, the error says

class Player is public, should be declared in a file named Player.java

Was that not what I did when I typed in public class Player, which is in a file called Player.java
15 years ago
Thanks for all the replies, unfortunately no-one gave me the actual solution which was to turn the page and carry on reading, you doughnut!!, Anywhoo, I now have a file called GuessGame.java which has the above code, then a file Player.java ;



and another file called GameLauncher.java ;



I have been able to compile Player.java but have not been able to compile GameLauncher.java or GuessGame.java, the error message is;

GuessGame.java:65: class Player is public, should be declared in a file named Player.java
public class Player {
^
GuessGame.java:74: class GameLauncher is public, should be declared in a file named GameLauncher.java
public class GameLauncher {
^
2 errors



Sorry to be such a pain but any help would be very welcome.

Cheers, Matt.
15 years ago
No, it is not elsewhere, this is the entirity of the example. I'll have to have another look at the book. Cheers, Matt.
15 years ago
Hi there, I am a newbie to Java and programming altogether. So far I seem to be doing okay but i've inputted one example from by book "head first java"

the error has come up as;

GuessGame.java:2: cannot resolve symbol
symbol : class Player
location: class GuessGame
Player p1;
^
GuessGame.java:3: cannot resolve symbol
symbol : class Player
location: class GuessGame
Player p2;
^
GuessGame.java:4: cannot resolve symbol
symbol : class Player
location: class GuessGame
Player p3;
^
GuessGame.java:7: cannot resolve symbol
symbol : class Player
location: class GuessGame
p1 = new Player();
^
GuessGame.java:8: cannot resolve symbol
symbol : class Player
location: class GuessGame
p2 = new Player();
^
GuessGame.java:9: cannot resolve symbol
symbol : class Player
location: class GuessGame
p3 = new Player();
^
6 errors

Cheers for the help,

Matt.

Also, the book says that it is for people with a knowledge of programming but there seems to be a definate lack of books for ABSOLUTE idiot beginners who don't know their arse from their integer.
15 years ago