Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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

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 Using Entity Relationship Diagrams

Authors: Sikha Saha Bagui, Richard Walsh Earp

3rd Edition

103201718X, 978-1032017181

More Books

Students also viewed these Databases questions

Question

Compare a delusion with a hallucination.

Answered: 1 week ago

Question

What is the preferred personality?

Answered: 1 week ago