Add a static field to the lineitem class that will count the


Java program needed

Enhance the Line Item application
This exercise guides you through the process of testing and enhancing the Line Item application.
1. Open the LineItemApp, Validator, Product, LineItem, and ProductDB classes that are in the c:java1.6ch06LineItem directory and review this code.
2. Compile all five classes. If the compiler throws an error that indicates that it can't "resolve" a class, you need to set your class path correctly.Once you've compiled these classes, run the LineItemApp class with valid codes like "java", "jsps", and "mcb2" to make sure that this application works correctly. Then,test it with an invalid code to see how that works.
3. Add another product to the ProductDB class. Its code should be "txtp", its description should be "TextPad", and its price should be $20.00. Then, compile just this class,and test the LineItemApp class again with the new product code. This shows that you can make a change to a class without affecting the other classes that use it.
4. Add a static field to the LineItem class that will count the number of objects that are created from the class as shown in figure 6-15. Next, add the code that incrementsthis field each time an object is created from this class, and add a method named getObjectCount that gets the value of this field. Then, compile that class.
5. Modify the LineItemApp class so it uses the getObjectCount method and displays the object count on the console after it displays each line item. Then, compile and run that class to make sure that the changes in steps 4 and 5 work correctly 

Request for Solution File

Ask an Expert for Answer!!
JAVA Programming: Add a static field to the lineitem class that will count the
Reference No:- TGS0112640

Expected delivery within 24 Hours