Help: A Simple Class


Help is available for each task, or you can go straight to the solution source code.

Task 1

Fill in the necessary variable declarations for the Employee class.
Two variables are needed, a String name, and an int, tenureInMonths.

Task 2

Write a constructor for Employee.
The public constructor for Employee takes a String as an argument, and assigns it to the name variable.

Task 3

Write the setTenure method for Employee.
This public method takes an integer argument and assigns it too the tenureInMonths variable.

Task 4

Add a call to setTenure in the main method.
Add the call just after the constructor call.

Copyright © 1996-1997 MageLang Institute. All Rights Reserved.