Hi, I'm completely brand new to Java, and have been learning from the books.
In one of the book exercises, I was supposed to copy and paste two scripts (VolcanoApplication.java & VolcanoRobot.java) and compile VolcanoApplication.java so I could run the program. Unfortunately, whenever try to compile VolcanoApplication.java in Cmd (Javac C:\ etc.), no class file is created and I get this error message:
I copied the code exactly from the book:
VolcanoApplication.java:
Code:
class VolcanoApplication {
public static void main(String[] arguments) {
VolcanoRobot dante = new VolcanoRobot();
dante.status = “exploring”;
dante.speed = 2;
dante.temperature = 510;
dante.showAttributes();
System.out.println(“Increasing speed to 3.”);
dante.speed = 3;
dante.showAttributes();
System.out.println(“Changing temperature to 670.”);
dante.temperature = 670;
dante.showAttributes();
System.out.println(“Checking the temperature.”);
dante.checkTemperature();
dante.showAttributes();
}
}
Look at your quotations. Those are characters, not quotations themselves, you need to modify them and replace them with proper ".
Everything else looks fine, so once the quotes are fixed you can compile VolcanoRobot and then VolcanoApplication.
Look at your quotations. Those are characters, not quotations themselves, you need to modify them and replace them with proper ".
Everything else looks fine, so once the quotes are fixed you can compile VolcanoRobot and then VolcanoApplication.
Thanks, that fixed that problem, however, I'm still receiving 2 errors after I changed the quotations. I've tried tampering around with the code, but nothing works.
Eclipse is (even though I hate it and wish it was visual studio) excellent. I would get familiar with debug mode and watch window etc. You can learn a lot just from debugging. Also and IDE like Eclipse will attempt to precompile the code and it will throw up at errors like that- and will even underline them in little squiggles letting you know something is wrong. It also has (if I am remembering correctly) color coding so you would see it propagating down (although Notepad++ does that too)
I'm a third for the Eclipse. I use it for both Java and PHP.
Yep to colour syntax (customizable as well as the formatting), auto completion available, scoping, auto format, debuggers, and lots of other fun stuff. Then you just hit the run / debug button and it compiles automatically. Exporting to a jar is also very easy to do.