LiveWire Network Peer Answers Peer Support Teen Forums Tech Forums College Forums 503 users online 225118 members 165 active today Advertise Here Sign In
TeenCollegeTechPhotos | Quizzes | LiveSecret | Memberlist | Dictionary | News | FAQ
Member Spotlight
RockerTori106
Interests: Singing, playing guitar, driving ar...
Mood: Romantic
You have 1 new message.
Emergency Help
Until you sign up you can't do much. Yes, it's free.

Sign Up Now
Membername:
Password:
Already have an account?
Invite Friends
Active Members
Groups
Contests
Moderators
3 online / 27 MPM
Fresh Topics
  LiveWire / Technical Forums / Programming & Application Development / Adding Reply

Quoting Post
Archived Topic: It will not be bumped to the top of the forum.
Topic Why won't this work?!
Membername   Not a member? Sign Up Free (takes 20 seconds)
Password   Forgotten your password?
Post

Font:   Size:   Color:

FAQ Keyword Search:
Post Options
Favorites Manager
Notify me of new replies to this topic by email
Notify me of new replies to this topic by private message
Original Post
ana Posted at 10:02 am on Aug. 11, 2006
I've been trying to learn Java from a book (because for some reason, I thought it was a good idea). It told me to make a file called VolcanoRobot.Java and put this in it:

Code:
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);
}
}

And then it says to make another file called VolcanoApplication.Java which has this inside:

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();
   }
}

When I try and compile the application, I get the following errors:

Code:
Ana:~ Ana$ javac desktop/Java/VolcanoApplication.Java
desktop/Java/VolcanoApplication.Java:3: cannot find symbol
symbol  : class VolcanoRobot
location: class VolcanoApplication
       VolcanoRobot dante = new VolcanoRobot();
       ^
desktop/Java/VolcanoApplication.Java:3: cannot find symbol
symbol  : class VolcanoRobot
location: class VolcanoApplication
       VolcanoRobot dante = new VolcanoRobot();
                                ^
2 errors

WHICH IS REALLY ANNOYING SINCE I DID EXACTLY WHAT THE BOOK SAID! I even copied the code off their website so I could make sure the problem was with the code, not something I'd done wrong...

Anyway, since that didn't work, I then combined the two files which let me compile it without a problem but it wouldn't let me run the program...

This is reeeeeeeeeallllllllllly annoying. Can someone help? Please?

Replies
ana Posted at 10:02 am on Aug. 11, 2006
I've been trying to learn Java from a book (because for some reason, I thought it was a good idea). It told me to make a file called VolcanoRobot.Java and put this in it:

Code:
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);
}
}

And then it says to make another file called VolcanoApplication.Java which has this inside:

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();
   }
}

When I try and compile the application, I get the following errors:

Code:
Ana:~ Ana$ javac desktop/Java/VolcanoApplication.Java
desktop/Java/VolcanoApplication.Java:3: cannot find symbol
symbol  : class VolcanoRobot
location: class VolcanoApplication
       VolcanoRobot dante = new VolcanoRobot();
       ^
desktop/Java/VolcanoApplication.Java:3: cannot find symbol
symbol  : class VolcanoRobot
location: class VolcanoApplication
       VolcanoRobot dante = new VolcanoRobot();
                                ^
2 errors

WHICH IS REALLY ANNOYING SINCE I DID EXACTLY WHAT THE BOOK SAID! I even copied the code off their website so I could make sure the problem was with the code, not something I'd done wrong...

Anyway, since that didn't work, I then combined the two files which let me compile it without a problem but it wouldn't let me run the program...

This is reeeeeeeeeallllllllllly annoying. Can someone help? Please?

All 14 previous replies displayed.