When to use Properties and when Map in Java?

前端 未结 9 668
抹茶落季
抹茶落季 2020-12-16 15:29

Difference between Map and Properties as both have key-value pair.

9条回答
  •  被撕碎了的回忆
    2020-12-16 15:46

    The Properties Class implements the Map-Interface. The Properties Class has Methods to save its content to a Stream.

    look at: http://java.sun.com/j2se/1.3/docs/api/java/util/Properties.html

    If you do not need to save the content, stay with a "normal" Map Implementation like HashMap

提交回复
热议问题