| | |
How come this program doesnt run?
![]() |
•
•
Join Date: Dec 2008
Posts: 65
Reputation:
Solved Threads: 1
How come this program doesn't run?
Well.. not just this program, all my other ones.
There are no mistakes, I wrote the code as this textbook says but its not running and its giving this error (on dr java):
1 error found:
File: (no associated file) [line: (no source location)]
Error: No compiler is available.
The code looks like this:
I saved it as Test.Disk
Well.. not just this program, all my other ones.
There are no mistakes, I wrote the code as this textbook says but its not running and its giving this error (on dr java):
1 error found:
File: (no associated file) [line: (no source location)]
Error: No compiler is available.
The code looks like this:
Java Syntax (Toggle Plain Text)
public class TestDisk { public static void main(String[] args) { Disk saucer = new Disk(10, 0.02); System.out.println("Disk radius: " + saucer.getRadius()); System.out.println("Disk surface area: " + saucer.area()); System.out.println("Disk volumn: " + saucer.volumn()); Disk plate1 = new Disk(12, 0.05); Disk plate2 = new Disk(12, 0.07); if (plate1.equals(plate2)) { System.out.println("objects are equal "); } else { System.out.println("Objects are not equal "); } System.out.println(plate1); System.out.println(plate2); } }
I saved it as Test.Disk
0
#2 Oct 6th, 2009
The name of the file should be the name of the class in an example like this one. Save your file as TestDisk.java
Did you mean to put the '.' in between Test and Disk?
Did you mean to put the '.' in between Test and Disk?
Last edited by Grn Xtrm; Oct 6th, 2009 at 6:20 pm.
Check out my new band URL on facebook. I'm the bass player. :) Become a fan and leave comments if you like.
URL on facebook!
URL on facebook!
1
#4 Oct 6th, 2009
Do you have the java compiler downloaded? When I first started Java I had trouble finding the compiler online (i think it was called JDK or something like that). You need this to run java code and I dont believe it comes with Java implementation environments such as Jcreator, TextPad, etc.
Check out my new band URL on facebook. I'm the bass player. :) Become a fan and leave comments if you like.
URL on facebook!
URL on facebook!
1
#6 Oct 6th, 2009
Read this if you have trouble finding the compiler or have any other questions
http://www.daniweb.com/forums/thread99132.html#
http://www.daniweb.com/forums/thread99132.html#
Check out my new band URL on facebook. I'm the bass player. :) Become a fan and leave comments if you like.
URL on facebook!
URL on facebook!
0
#8 Oct 6th, 2009
•
•
•
•
I have dled the JDK.
Now I have Jdk and Drjava.
But now when I try to run this program there like like 14 errors.......
I don't get it..
The class in which the Disk constructor is defined must be in the same folder/directory as the TestDisk class.
You do have a file with the Disk constructor right?... Or did you actually just copy that one part out of your book?
Last edited by Grn Xtrm; Oct 6th, 2009 at 7:35 pm.
Check out my new band URL on facebook. I'm the bass player. :) Become a fan and leave comments if you like.
URL on facebook!
URL on facebook!
•
•
Join Date: Oct 2009
Posts: 14
Reputation:
Solved Threads: 0
Some things you may wish to consider,
"Disk", can I see source of it?
"Disk"s constructor...is it expecting an integer then a double?
if (plate1.equals(plate2))...did you programme "equals" In Disk?
instead of printing plate1 try printing the plate1.toString which you should have programmed to simplify things
any corrections of my post pm me please
"Disk", can I see source of it?
"Disk"s constructor...is it expecting an integer then a double?
if (plate1.equals(plate2))...did you programme "equals" In Disk?
instead of printing plate1 try printing the plate1.toString which you should have programmed to simplify things
any corrections of my post pm me please
![]() |
Similar Threads
- C++ Fraction Program- Need alittle extra (C++)
- help - i changed the name of a folder and now my program doesnt run properly (Java)
- My Program doesnt run, afer installing the setup file. Plz help. (Visual Basic 4 / 5 / 6)
- Pascal : Cant see why program wont run, exits with error. (Pascal and Delphi)
- my program is compiled.but on run that i have message "Exception in thread "main" jav (Java)
- Using MFC in a Static Library (C++)
Other Threads in the Java Forum
- Previous Thread: Moving to Ingres is Easier, Company Says
- Next Thread: How come it gives this error when I run a program?
| Thread Tools | Search this Thread |
android api applet application apps array arrays automation awt bidirectional binary birt bluetooth businessintelligence busy_handler(null) card chat class classes client code collision columns component constructor crashcourse database designadrawingapplicationusingjavajslider draw eclipse error errors eventlistener exception expand fractal game givemetehcodez graphics gui guidancer html ide image inetaddress integer intellij j2me java javafx javamicroeditionuseofmotionsensor javaprojects jme jni jpanel jtree julia linux list loop machine map method methods mobile mobiledevelopmentcreatejar myaggfun netbeans newbie oracle physics plazmic print problem program programming project recursion scanner server set sharepoint smart sms smsspam sort sortedmaps sql string subclass support swing textfield threads tree trolltech unlimited utility webservices windows





