Java??Properties??????
???????????? ???????[ 2015/12/28 11:20:58 ] ??????????????????? ???????
????????????????????????????????????????????????????????????????????????漰?????????Properties????????????Java????t???????????Щ??????????Java??д??????Щ???????Python??Perl?????????????????????????????????Java?????????Щ????????????????????????Properties???????????
???????Java Properties??
????Java???и???????????Properties??Java.util.Properties?????????????Java????????????????????????????????????????????????к??????????????????????????????????????????????????????????????????á???Python?????????????.ini????????????????????????????????ConfigParse???????????????????????????????.ini???????????Java?У?????????????.properties???????????????????????????????“??=?”?????????????????????"#"??????
????Properties??????Hashtable?????£?
???????????????????????
????1?? getProperty ( String key)??????????????????б?????????????????????? key ????? key ??????? value??
????2?? load ( InputStream inStream)???????????ж???????б?????????????????????????????????????? test.properties ???????????????????????е????м? - ??????? getProperty ( String key) ????????
????3?? setProperty ( String key?? String value) ?????? Hashtable ????? put ???????????????put?????????? ?? - ????
????4?? store ( OutputStream out?? String comments)?????????? load ????????? Properties ???е????????? Properties ???е??????б???????????д??????????? load ?????????÷??????? - ???д???????????????
????5?? clear ()????????????? ?? - ?????÷??????????????
????????Java???Properties???
????Java???Properties?????????к??????? Java???Properties????????????
??????????????????java.lang.Class???getResourceAsStream(String name)??????????????????????????
????InputStream in = getClass().getResourceAsStream("???Name");???????д????????????????
??????????????????????
????InputStream in = new BufferedInputStream(new FileInputStream(filepath));
??????????????
?????????о??????????????Properties??????????
?????????????Java???????JVM????????????????????system.properties????????????????????????????
????1?????JVM????????
????1 import java.util.Properties;
????2
????3 public class ReadJVM {
????4 public static void main(String[] args) {
????5 Properties pps = System.getProperties();
????6 pps.list(System.out);
????7 }
????8 }
?????????
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11