Question: 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

Please read the question and answer them correctly 1. The following class

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 errors

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!