Your student class is fine.
The get/set usefulness will appear when you change the implementation. For instance, gender can only be 'male' or'female'. So when someone wants to set or change the gender of a student, you can check in the setGender method that he's putting 'male' or 'female', and refuse to do anything, throw an error or react however you like if they try to say setGender( "42" ). IF you leave the data public, you can have all kinds of spurious values in your fields.
Quote:
I recommend using a Vector for the list.
|
Note the assignment says array. I'd go with a Vector (or List) too, because using a java array would be totally stupid in this context. I suppose "array" was ment as a general term and not the [] thing.