0

Is the Student class ok as is? Or do I need to use the constructor for the fields like you mentioned for the Date and Address classes?

0

You know, I haven't looked at your classes very closely - just enough to identify the things you've been concerned about.

Now that I look at it, I don't see any need to separate the stuff in parse into a separate method. But since it's the way it is, and it works, you may as well leave it. Next time you do something like this, let the constructor do the setup work, that's what it's paid for.

There are exceptions, of course, but I'll leave it to you to work out some cases when you might have to put some of the setup outside of the constructor.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.