View Single Post
  #12 (permalink)  
Old 01-22-2008, 04:39 AM
CaptainMorgan's Avatar
CaptainMorgan CaptainMorgan is offline
Moderator
 
Join Date: Dec 2007
Location: NewEngland, US
Posts: 841
CaptainMorgan will become famous soon enoughCaptainMorgan will become famous soon enough
Send a message via AIM to CaptainMorgan
Ill rewrite your updated code with some hints:

Code:
package firstproject; import java.util.*; public class Main { // entry point of the program public static void main(String[] args) {} // program starts and ends here String status; // instance variable of type String int speed; // instance variable of type int float Temperature; // instance variable of type float // method of the Main class, returns nothing void checkTemperature() { if (Temperature > 660) { status = "returning home"; speed = 5; } } // end of method checkTemperature // method of the Main class, returns nothing. void showAttributes() { System.out.println("Status: " + status); System.out.println("Speed: " + speed); System.out.println("Temperature: " + Temperature); } // end of method showAttributes } // end of class Main
Quote:
I switched where i put the '}' bracket to fix the errors. But now like I said the programs output is nothing.
Also, switching brackets around like a matching game does nothing for your understanding because you don't actually know why you're moving them around. Your book will have the answer you're looking for.
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
to our beloved Java Forums!
(closes on September 4, 2008)
Want to voice your opinion on your IDE/Editor of choice?
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
!
Got a little Capt'n in you? (drink responsibly)
Reply With Quote