For example if an error occurs inside the constructor (e.g. the parameters pass in were invalid) and I wanted to stop an object being created would it be possible to return null rather than a reference to a new object. (I know the term return is technically correct in this case but you know what I mean).Basically, is it possible to cancel object creation?
Please guide me to get out of this issue…
Yes, you can throw an exception, which will terminate object creation. You cannot return null or any other value from a constructor.