I am new to Java and have been trying to teach myself from several books, currently "Sams Teach Yourself Java 6 in 21 Days", and I'm sadly stuck on the first day. I need to compile a simple application (and I guess a class too? I'm not sure if that needs to be compiled, but I tried anyway).
I have two errors when I try to compile the class:
http://i495.photobucket.com/albums/r...oboterrors.jpg
The original code is:
I also have two errors when I try to compile the application: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); } }
http://www.mediafire.com/imgbnc.php/...bace96076g.jpg
The original code for the application is:
I'm sure the problem is rather obvious, but I'm new to programming and Java, so I don't catch the obvious yet. Any and all help is appreciated! And sorry about the image links, but I don't know how to copy straight from Command Prompt :\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 temperatire to 670."); dante.temperature = 670; dante.showAttributes(); System.out.println("Checking the temperature."); dante.checkTemperature(); dante.showAttributes(); } }