subject

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.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 22:40
Write an assembly program with the following specifications.a). in the main block, you should have two registers r4 and r5. they should be checked in an infinite loop. if r4 is greater than r5, then the greater subroutine will be called. if r4 is less than r5, then the less subroutine will be called. if r4 equals r5, then no operations will be done
Answers: 1
question
Computers and Technology, 22.06.2019 19:30
Avariable definition defines the name of a variable that will be used in a program, as well as
Answers: 3
question
Computers and Technology, 22.06.2019 20:00
How is the number 372 written when expanded out to place values in the base 8 (octal) number system? a. 2 x 4 + 3 x 2 + 4 x 1 b. 3 x 64 + 7 x 8 + 2 x 1 c. 3 x 8 + 7 x 7 + 2 x 6 d. 3 x 100 + 7 x 10 + 2 x 1
Answers: 1
question
Computers and Technology, 23.06.2019 11:00
In the context of the box model, what is the difference between a margin and a padding? a. a padding lies outside a box border, while a margin lies inside it. b. a padding lies inside a box border, while a margin lies outside it. c. a padding can be adjusted independently, while a margin depends on the size of its box. d. a padding depends on the size of its box, while a margin can be adjusted independently.
Answers: 3
You know the right answer?
The following class contains several errors that violate the rules of java: 1. class thermometer {...
Questions
question
Chemistry, 03.08.2021 01:00
question
Business, 03.08.2021 01:00
question
Mathematics, 03.08.2021 01:00
question
English, 03.08.2021 01:00
Questions on the website: 13722360