Is making an empty string constant worth it?

前端 未结 18 868
無奈伤痛
無奈伤痛 2021-01-01 10:11

I have a co-worker that swears by

//in a singleton \"Constants\" class
public static final String EMPTY_STRING = \"\";

in a constants class

18条回答
  •  忘掉有多难
    2021-01-01 10:56

    1. yes--it offers no benefit.
    2. depends on what you're used to, I'm sure.
    3. No, it's just a constant--not an abuse.

提交回复
热议问题