Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please read the question and answer them correctly 1. The following class contains several errors that violate the rules of Java 1. class Part 2.
Please read the question and answer them correctly
1. The following class contains several errors that violate the rules of Java 1. class Part 2. private int number; private String name; private int quantity; public Part (int number, String name, int quantity)( 4 6. 7 this.number number this.name name; this.quantityquantity 9 10. 12. public Part (int number, string name) ( this (number, name,e); 13. 14. 15. public Part() this (0, No name') 16. public void decreaseQuantity(int amount) quantityamount; 18. 19. public int getName ) 20. 21. return name; 22 public int getnumber) 23. 24 return number 25. 26. 27. public int getQuantity() return quanity 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 the 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 complier. You should ignore these errorsStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started