Java:将变量存储在文件中 [英] Java: Store variables in file
本文介绍了Java:将变量存储在文件中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我知道如何将文本写入文件并将其存储在Java中,但我想知道是否有一种方法可以存储大量可以在以后从文件中检索的变量,并将其放回到Java中应用作为变量。
I know how to write text to a file and store it in Java, but I was wondering if there is a way of storing lots of variables that can be retrieved from the file at a later date, and put back into the Java application as variables.
我会存储数字和字符串,但是存储它们的组。
I would be storing numbers and strings, but groups of them.
谢谢:)
推荐答案
Java可以读取属性文件,就像读取地图一样。这使您可以使用键/值系统轻松存储信息。
Java can read properties files like it reads a map. This gives you an easy way of storing information using a key/value system.
查看 http://download.oracle.com/javase/6/docs/api/java/util/Properties.html
这篇关于Java:将变量存储在文件中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文