开发者

what is the data type of "value" acsessed from properties file

开发者 https://www.devze.com 2023-03-25 08:55 出处:网络
I am accessing value in my java file like mentioned bellow.So what is the data type of \"value\" acsessed from properties file. Iwanted to know which class needs to imported to use 开发者_如何学运维pr

I am accessing value in my java file like mentioned bellow.So what is the data type of "value" acsessed from properties file. Iwanted to know which class needs to imported to use 开发者_如何学运维properties ?

Properties properties = new Properties();
properties.load(new FileInputStream("path/filename"));


Your values will be of String type, you can parse them into int / double / whatever you want.


Per the Java docs:

 String     getProperty(String key) 
 Object     setProperty(String key, String value) 

So you're storing and retrieving string values for each property key and each property value.

0

精彩评论

暂无评论...
验证码 换一张
取 消