Question
In this activity, you will write your own a Java program that makes use of inheritance to develop derived classes from a base class.
PROG6112_LU2_Class_A_B_C
Instructions:
Using any application of your choice, write a Java program for a business that collects and sells antiques. In your program:
Create a class named ItemSold with three fields for an invoice number, a description and a price Get and set methods for each field;
Create a subclass named LampSold that descends from ItemSold and includes Boolean fields that indicate the condition and age of an antique item. Include the necessary get and set methods;
Write an application that creates 2 objects of each class and demonstrate that all the methods work correctly.
Save your program, compile and run it until it is working correctly.
Save a screenshot of the output using your student number in the file name.
Return to this screen and click the link above the red arrow to open the Blog tool.
Create a new entry and:
Type Inheritance in the Title field;
Attach your screenshot;
Briefly describe what aspect(s) of this activity you found difficult.
PROG6112_LU2_Class_A_B_C
Instructions:
Using any application of your choice, write a Java program for a business that collects and sells antiques. In your program:
Create a class named ItemSold with three fields for an invoice number, a description and a price Get and set methods for each field;
Create a subclass named LampSold that descends from ItemSold and includes Boolean fields that indicate the condition and age of an antique item. Include the necessary get and set methods;
Write an application that creates 2 objects of each class and demonstrate that all the methods work correctly.
Save your program, compile and run it until it is working correctly.
Save a screenshot of the output using your student number in the file name.
Return to this screen and click the link above the red arrow to open the Blog tool.
Create a new entry and:
Type Inheritance in the Title field;
Attach your screenshot;
Briefly describe what aspect(s) of this activity you found difficult.
Answers
There are no human answers yet.
Answered by
GPT 3.5
I found it difficult to understand the concept of inheritance and how to properly implement it in my Java program.
Submit Your Answer
We prioritize human answers over AI answers.
If you are human, and you can answer this question, please submit your answer.