A subclass having small logic and it’s return Boolean true/false or error message but in case of any exception it catch into an same class and error message just for intimation to the upper class which used to show error message in UI.i’m n’t able to think about how to manage subclass return value because if subclass works successfully it return Boolean true/false,but in case of error it return String error message this point i found problem of two different type of return value from method.please help me how can i solve this problem.
A subclass having small logic and it’s return Boolean true/false or error message but
Share
You have two options return an object
or throw an Exception if an error occurs