Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design Application Development And Administration

Authors: Michael V. Mannino

4th Edition

0615231047, 978-0615231044

More Books

Students also viewed these Databases questions

Question

Compare a delusion with a hallucination.

Answered: 1 week ago