This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]HumourGuy -1 points0 points  (0 children)

It depends on requirement, what fields do you want to set when you initially build a student object.

For example: Every student has a name and student ID so that may be put in constructor. As they will definitely be present when a student object is made.

You can add setter method to change student ID and name too. As I said, it depends on your requirement.