Back to Archive
Computer Science
QID: #12813
Subject: Computer Science
Status: Verified Solution Available
Fix the bugs in the following code.
public class Temperature
{
private double temperature;
public static double maxTemp = 0;
public Temperature(double t)
{
temperature = t;
if (t > maxTemp)
maxTemp = t;
}
public static printMax()
{
System.out.println(temperature);
}
public static void main(String[] args)
{
Temperature t1 = new Temperature(75);
Temperature t2 = new Temperature(100);
Temperature.printMax();
}
}
ZERO AI
Human Written
Human Written
PHD EXPERTS
Verified
Verified
TURNITIN
Clean Report
Clean Report
24/7 SUPPORT
Instant Help
Instant Help