Basically how do you check if an object is null or empty. What I mean is that if I have an object instantiated but all its values or fields are null, the how do I check in code if it is empty?
I have tried;
if (doc != null){
.... do something
But it doesn’t seem to work.
You can’t do it directly, you should provide your own way to check this. Eg.
Or make all fields final and initialize them in constructors so that you can be sure that everything is initialized.