-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPropertiesClass.java
More file actions
29 lines (23 loc) · 1 KB
/
PropertiesClass.java
File metadata and controls
29 lines (23 loc) · 1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package Framework;
import java.io.*;
import java.util.Properties;
public class PropertiesClass {
public static void main(String[] args) throws IOException {
Properties P = new Properties();
P.setProperty("562", "Regression");
P.setProperty("230", "Classification");
P.setProperty("795", "CocktailParty");
System.out.println(P);
// FileOutputStream FOS = new FileOutputStream("C:\\MyJava\\ML.txt");
// P.store(FOS, "Algo of ML in text");
/* FileOutputStream FOS = new FileOutputStream("C:\\MyJava\\ML.xml");
P.storeToXML(FOS, "Algo of ML in XML"); */
// P.forEach((k,v)-> System.out.println(k+" -> "+v));
FileInputStream FIS = new FileInputStream("C:\\MyJava\\ML.xml");
P.loadFromXML(FIS);
P.forEach((k,v)-> System.out.println(k+" -> "+v));
System.out.println(P.getProperty("720"));
P.load(new FileInputStream("C:\\MyJava\\MyML.txt"));
System.out.println(P.getProperty("Platform"));
}
}