Best way to return status flag and message from a method in Java

后端 未结 17 1241
清酒与你
清酒与你 2020-12-25 12:55

I have a deceptively simple scenario, and I want a simple solution, but it\'s not obvious which is \"most correct\" or \"most Java\".

Let\'s say I have a small authe

17条回答
  •  盖世英雄少女心
    2020-12-25 13:15

    How about returning a string. Empty or Null for success. Error Message in case of failure. Simplest that would work. However not sure if it reads well.

提交回复
热议问题