Question: Objectives: In this lab, the following topic will be covered: 1. Inheritance Task Create a class called Question that contains one private field for

Objectives: In this lab, the following topic will be covered: 1. Inheritance

Objectives: In this lab, the following topic will be covered: 1. Inheritance Task Create a class called Question that contains one private field for the question's text. Provide a single argument constructor. Override the toString() method to return the text. Create a subclass of Question called MCQuestion that contains additional fields for choices. Provide a constructor that has all the fields. Override the toString() method to return all data fields (use the toString() method of the Question class). wwwwwwww Write a test program that creates a MCQuestion object with values of your choice. Print the object using the toString method.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!