So I searched the forums and the net and have to admit I'm hesitant of using a forum for answers but frankly I'm running out of idea's here. I picked up Sams Teach yourself Java 6 in 21 days and I am trying to get the blasted thing set up. Originally it was giving me a error "cannot find symbol" (2 errors) when I attempted to compile it. I changed from using Notepad to using ViM to write the code out again, now I have only 1 error. it reads as follows
VolcanoApplication.java:16: cannot find symbol
symbol : method checkTemperature()
Location: class VolcanoRobot
dante.checkTemperature();
-------^
1 error
It seems to hate that period....
Some quick background----
I am new to programming in Java
I am running Windows 7 Pro
I have already set PATH in my enviroment variables and running jdk version 6
Both .java files are in the same directory.
I have attached Volcano Applications code below
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(); } }
Here is the VolcanoRobot.java aswell
class VolcanoRobot { String status; int speed; float temperature; void checktemperature() { if (temperature > 660) { status = "returning home"; speed = 5; } } void showAttributes() { System.out.println("Status: " + status); System.out.println("Speed: " + speed); System.out.println("Temperature: " + temperature); } }