Can someone double check this java coding? I'm getting an error?
Can someone double check this java coding? I’m getting an error?
i get the error: cannot find symbol – class Thermometer
import java.util.*;
public class TestProgThermometerTester
{
static Scanner console = new Scanner(System.in);
public static void main(String[] args)
{
Thermometer myThermometer = new Thermometer(35);
Thermometer yourThermometer =
new Thermometer();
int temperature;
System.out.println(“Line 10: myThermometer: ”
+ myThermometer);
System.out.println(“Line 11: yourThermometer: ”
+ yourThermometer);
yourThermometer.setCurrentTemperature(34);
System.out.println(“Line 13: After setting ”
+ “yourThermometer: ”
+ yourThermometer);
System.out.print(“Line 14: Enter the ”
+ “current temperature: “);
temperature = console.nextInt();
System.out.println();
myThermometer.setCurrentTemperature(temperature);
System.out.println(“Line 18: myThermometer: ”
+ myThermometer );
}//end main
}
If someone could tell me how to fix it too I would appreciate it. I’m taking a java class and pretty new to this.
Best answer:
you haven’t created a class named “Thermometer”, You have only created a main class called “TestProgThermometerTester”.
Tags: check, coding, double, error, getting, java, someone, this
Under Forum

Leave a Comment for Can someone double check this java coding? I'm getting an error?
Trackback this post | Subscribe to the comments via RSS Feed