Given the following code for a class named Employee , complete the following constructor public class Employee
Question:
Given the following code for a class named Employee, complete the following constructor
public class Employee (
private int employeeID;
private int SSN;
public Emplyee(int employeeID, int SSN)
{
2. A class named Test has been defined as follows: public class Test { private int aNum; private int bNum;
public Test() { } public void setNums(int x, int y) { aNum= x; bNum= y; } } Given the values of aNum and bNum are 13 and 72, write the toString() method for this class will display the class fields in the format below. The values of aNum= 13 and bNum= 72
3.
Write the class method, makeArray(), to declare an array with 5 elements for theTest2 classbelow. The method should also instantiate it with class instances where the values of num1 are consecutive odd numbers starting with 1 and the values of num2 are consecutive even numbers starting with 2. The method will be called as indicated by the following code.
public class Test2 { private int num1; private int num2; public Test2() { } public void setNums(int a, int b) { num1 = a; num2 = b; } } ________________________________________ class NumArray { public class void main(String[] args) { Test2[] array; array = makeArray(); }
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill