Why do you not declare several variables of the same type on the same line?

后端 未结 16 2218
梦谈多话
梦谈多话 2020-12-06 05:41

Why is it bad practice to declare variables on one line?

e.g.

private String var1, var2, var3

instead of:

private          


        
16条回答
  •  眼角桃花
    2020-12-06 05:52

    Because in some languages, var2 and var3 in your example would not be strings, they would be variants (untyped).

提交回复
热议问题