|
-
Jan 12th, 2007, 08:46 PM
#1
Thread Starter
New Member
Please Help Beginner Java
Hi just started learning Java and have created a class from a book and a method so it can be run as a program i know the code is correct as i got it from books website.
VolcanoRobot.java
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);
}
}
Volcan Application.java
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();
}
}
When i try and run VolcanoApplication i get the error:
VolcanoApplication.java:3: cannot find symbol
symbol : class VolcanRobot
location : class VolcanoApplication
and then the V in line 3 is highlighted
Please help!!!!!!!!!!!!!!!!!!!!!!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|