Answered step by step
Verified Expert Solution
Question
1 Approved Answer
1. The following class contains several errors that violate the rules of Java: 1. class Part f private int number private String name; private int
1. The following class contains several errors that violate the rules of Java: 1. class Part f 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.quantity- quantity; 9 10. public Part (int number, string name) this (number, name,0); 12. 13 public Part) 14 15. this(e, 'No name); public void decreaseQuantity(int amount) f 16. 17 18. quantityamount; 19. 20 21. public int getName() f return name 22. public int getnumber) 23. 24 return number; 25. public int getQuantity) 26 27.} 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
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