Limited access

Upgrade to access all content for this subject

Which of the following segments of code would correctly declare variables to store an employee’s name, age (in whole years), anniversary year, number of dependents, and spouse’s name?

I.

String emplName, String spouseName;
int age, int anniversary, int dependents;

II.

String emplName; String spouseName=null;
int age; int anniversary; int dependents=null;

III.

String emplName, spouseName;
int age, anniversary, dependents;
A

I only.

B

II only.

C

III only.

D

I and II only.

E

II and III only.

Select an assignment template