Skip to content

Author: kumaresan

Is it better to return NULL or empty values from functions/methods where the return value is not present?

Posted in Education, and WhoCodeFirst

Returning null is usually the best idea if you intend to indicate that no data is available. An empty object implies data has been returned, whereas returning null clearly indicates that nothing has been…