View Single Post
  #1 (permalink)  
Old 01-21-2008, 11:17 PM
Wizard wusa Wizard wusa is offline
Member
 
Join Date: Jan 2008
Posts: 10
Wizard wusa is on a distinguished road
What's wrong with this code?
I am using the book Sams teach yourself Java 6 in 21 days and I'm stuck on the first code in Netbeans. I've tried everything I could think of but nothing works please help .

Code:
package firstproject; import java.util.*; public class Main { public static void main(String[] args) { 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); } } }
The lines underlined get this error:

illegal start of expression
';' expected


I've tried putting the ; everywhere but it still has that error.
Any help is welcome thanks!
Reply With Quote
Sponsored Links