This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
what exactly do you mean by "it doesn't run"? When you try to run it, the OS probably gives you a message telling you exactly what the problem is. That information is actually very helpful in determining the solution - in fact, it is critical.
Please post the exact and complete error message. without it, all we can do is guess at any of the dozen or so possible things it could be.
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Joined: Oct 24, 2009
sorry about that.
this is what i get:
main method not found in class DrumKit, please define the main method as: public static void main (String args )
That's the most helpful error message I think I've seen. It tells you plainly that the compiler is looking for the main() method in your class DrumKit. That's because your file is named DrumKit.java, and the compiler is expecting the class of the same name to contain the required main() method.
You could change the file name to "DrumKitTestDrive.java" or move your existing main() method to your DrumKit class and eliminate the DrumKitTestDrive class entirely, depending on your program or assignment's requirements.
Always learning Java, currently using Eclipse on Fedora.
Linux user#: 501795
I think you ought to keep the multiple classes. That is one of the nice things about Head First; they give you the classes and a different class to run them from. It is a good ot become accustomed to using multiple classes.