Is it dvisable to throw exceptions inside the setter mehods ?
For example :
Thanks in advance.
Save India From Corruption - Anna Hazare.
posted 7 years ago
Yes. Good idea.
But you should be circumspect about what sort of Exception you are throwing. I would enhance what you have written toNote that much of what I wrote is actually documentation comments, so users of that method know about the Exception.