In fact, System.getProperty()
uses the java.util.Properties
object internally. The Properties
class extends HashTable<Object,Object>
, so sou is unlikely to get much performance by explicitly using the HashMap
.
However, if you use several properties very often, this will certainly help if you save them in variables. A HashTable / HashMap search and variable access can be like O (1), but a HashTable search definitely has a much larger constant coefficient.
source share