How to name a HashMap in Java?

后端 未结 9 1694
难免孤独
难免孤独 2021-02-01 00:55

This might be a silly question, but I have never found a satisfying way to name a variable of type HashMap in Java. For example - lets say I have a

9条回答
  •  难免孤独
    2021-02-01 01:09

    I don't believe there is a hard-written rule anywhere that tells you how to name your map, so as long as you come up with a rule that makes sense to you (and your teammates), then it should be fine.

    Personally, I like to call my maps keyToValue or valueByKey.

提交回复
热议问题