This week's book giveaway is in the Mac OS forum. We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line! See this thread for details.
If you dont want to make your class RollTheDice as public then keep it in the same file as TestRollDice and compile it as TestRollDice.java
Joined: Jun 06, 2008
Also to add you can compile them seperateky by keeping both the files in the same package.
Joined: Aug 16, 2007
Continue to Rodrigo... and the file containing that class(RollTheDice) need to be in the same package where 'TestRollDice' is.Otherwise you need to make the method (run) public.
There are couple of ways to make it run.
1) Put both the class in the same *.java file and you don't need to make any damn change.
2) Make two java files for both the class and put them in same package. 3) or put them in different package.
In 2 and 3 option you need to take care about the visibility of method and class.
Joined: Jun 01, 2008
Thank you so much for the reply. I solved the problem by saving it to my USB/Memory stick. I cannot undertand why it does not run when my files is in laptop documents. Maybe because I am running vista?
And also I am not into package yet so I do not know what it means yet. I m really a beginner beginner.
I do not know how it solved the problem but it did. Saving it to the documents does not run it but once i save it to the usb then run it to the usb it works perfectly. [ June 13, 2008: Message edited by: Beth Laguardia ]