Question: The following class contains several errors that violate the rules of Java: class Part ( private int number: private String name: private int quantity: public

 The following class contains several errors that violate the rules of

The following class contains several errors that violate the rules of Java: class Part ( private int number: private String name: private int quantity: public Part (int number, String name, int quantity) { this.number = number: this.name = name: this quantity = quantity: } public Part (int number, string name) { this (number, name, 0): } public Part () { this (0, 'No name'): } public void decreaseQuantity(int amount) { quantity = -amount: } public int getName () { return name: } public int getnumber () { return number: 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 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

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!