question archive Fix the bugs in the following code

Fix the bugs in the following code

Subject:Computer SciencePrice:2.87 Bought7

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

 }

 }

 

Option 1

Low Cost Option
Download this past answer in few clicks

2.87 USD

PURCHASE SOLUTION

Option 2

Custom new solution created by our subject matter experts

GET A QUOTE

rated 5 stars

Purchased 7 times

Completion Status 100%

Related Questions