View Single Post
Old 08-27-2009, 08:50 AM   #8 (permalink)
captainmerton
The Acquainted
 
captainmerton's Avatar
 
Join Date: May 2009
Posts: 178
Thanks: 9
captainmerton is on a distinguished road
Default

No we are on the same page apologies i misunderstood you. I think what you are suggesting is exactly what i'm looking for. I can set default values for both variables as spaces in the class and throw an exception if either has a value of spaces when the class is called. If I pass in the variables when calling the class this will override the default values set in the class.

Next question - is throwing an exception in a constructor method bad practice as it leaves a half instantiated object?

Many Thanks.
captainmerton is offline  
Reply With Quote