U.Smith U.Smith - 1 year ago 90
Java Question

Java Define char Instance Variable

I am currently doing exam revision questions for Intro to Programming and I came across this question.

Define a char instance variable academicLevel to store the academic level for the employee. The possible values for academic levels are in the range A—E (A=associate lecturer, B=lecturer, C=senior lecturer, D=associate professor, E=professor).

And I'm not exactly sure how it wants me to 'define'. Just like this?

private char academicLevel;

Answer Source

I believe it is asking you to define a char instance, just like you did, and then implement some code (ie : a switch) to filter the possible values

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download