Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

java store data

//Open a file
File properties = new File("properties.txt");

//Writing
Properties p = new Properties();
p.setProperty("johndoe.pin", "12345");
p.store(new FileOutputStream(properties), null);
        
//Reading
Properties p = new Properties();
p.load(new FileInputStream("properties.txt", "");
p.getProperty("johndoe.pin"); //Returns the value if presents, otherwise null
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #java #store #data
ADD COMMENT
Topic
Name
5+1 =