This content has been marked as final. Show 3 replies
This sounds the wrong way around. What is the return value of bookTable(Customer)?
I'd expect it to return a Booking object that it creates.
Generally, you want the constructor to do as little as possible (while still only ever returning in a valid state, of course!).
The problem you can get when you call other methods is that you introduce the possibility of other objects getting access to your object before the constructor has finished running (i.e. before the object is completely initialized). This can lead to nasty problems that are hard to find and debug.