There's only one problem with that code: that doesn't actually block the user from creating the object with null parameters, it just tells the user that they have done so. The easiest way is to throw...
Type: Posts; User: helloworld922
There's only one problem with that code: that doesn't actually block the user from creating the object with null parameters, it just tells the user that they have done so. The easiest way is to throw...
Yes, I know, but what mechanism will you have in place to ensure null isn't allowed? throw an exception? set it to an empty string?
What do you want to program to do if the inputs are null?