Show an example of a class definition that creates a subclass of an existing Employee class, and adds a private double field called commissionRate. What is the total set of fields that an instance of the new class contains?
What will be an ideal response?
The class definition provided should be similar to the following:
class CommissionEmployee : Employee
{
private double commissionRate;
}
Each CommissionEmployee object automatically contains the data fields of the base class (Employee in this case) plus any new fields that are added (commissionRate in this case).
You might also like to view...
Which of the following partition states is required to allow a Windows OS to boot?
A. Active B. Logical C. Healthy D. Primary
Although a web enabled application appears to only allow letters in the comment field of a web form, malicious user was able to carry a SQL injection attack by sending special characters through the web comment field.Which of the following has the application programmer failed to implement?
A. Revision control system B. Client side exception handling C. Server side validation D. Server hardening