| Author |
class and testclass
|
Besjamain Greenaway
Ranch Hand
Joined: Dec 21, 2007
Posts: 45
|
|
Hello :-) I am working throught the head first book, and the subject now is about making a class and testclass. I get the impression that these two files should be seperate, so with one of the exercises I had to do I did; and the testclass; When I run it, it seems to compile, but then an error emerges; DrumkitTestDrive.java:13: cannot find symbol symbol : method playsnare() location: class Drumkit d.playsnare(); ^ there's another one that says java:10:. I've looked on the internet, and get the impression that something is not installed to make it work. Is this true?
|
 |
Henry Wong
author
Sheriff
Joined: Sep 28, 2004
Posts: 16815
|
|
DrumkitTestDrive.java:13: cannot find symbol symbol : method playsnare() location: class Drumkit d.playsnare();
Java is case sensitive. The method is playSnare(), with a capital S. The compiler can't find one with the lower case s. Henry
|
Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
|
 |
Besjamain Greenaway
Ranch Hand
Joined: Dec 21, 2007
Posts: 45
|
|
Thanks a lot! But wow, is that emberassing! Just a simple syntax prob
|
 |
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 32833
|
|
We have all made that sort of mistake. You could have written play Snare() instead, which has another error in. Please don't write "if (d.snare == true) . . ." Write "if(d.snare) . . ." The "== true" is unnecessary. Try it.
|
 |
 |
|
|
subject: class and testclass
|
|
|