Computers and Technology
Computers and Technology, 04.07.2019 18:20, hollis79

The following class contains several errors that violate the rules of java: 1. class thermometer { 2. private int temperature 3. public thermometer(int degrees) { 4. temperature = degrees; 5. } 6. public thermometer() { 7. temperature = 0.0; 8. } 9. public void makewarmer(int degrees) { 10. temperature =+ degrees; 11. } 12. public void makecooler(int degrees) { 13. temperature -= degrees; 14. } 15. public gettemperature() { 16. return temperature; 17. } 18. public string tostring() { 19. return temperature + ' degrees'; 20. } 21. } describe each error and specify whether it is (a) lexical, (b) syntactic, use the numbers shown to identify the line on which each error occurs. the class may also contain programming errors tected by a java compiler. you should ignore these errors (c) semantic. or that do not violate the rules of java and will not be detected by a java compiler. you should ignore these errors.

answer
Answers: 1

Similar questions

Do you know the correct answer?
The following class contains several errors that violate the rules of java: 1. class thermometer {...

Questions in other subjects: