Home » JAVA Programming » Java Basic » Question
  1. What should the return type of method where there is no return value?
    1. Empty collection
    2. Null
    3. Empty String
    4. Singleton collection
    5. None of these
Correct Option: A

Returning Empty collection is a good practice. It eliminates chances of unhandled null pointer exceptions.



Your comments will be displayed only after manual approval.