Question: The following class contains several errors that violate the rules of Java: class Thermometer { private int temperature public Thermometer (int degrees) { temperature =

The following class contains several errors that violate the rules of Java: class Thermometer { private int temperature public Thermometer (int degrees) { temperature = degrees: } public Thermometer () { temperature = 0.0: } public void makewarmer (int degrees) { 10 temperature = + degrees: public void makeCooler (int degrees) { temperature - = degrees: public getTemperature () { return temperature: } public string tostring() { return temperature + ʼn: degrees ': } } Describe each error and specify whether it is (a) lexical, (b) syntactic, or (c) semantic. Use the numbers shown to identify the line on which each error occurs. The class may also contain programming errors that do not violate the rules of Java and will not be detected by a Java compiler. You should ignore these errors
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
