PropertiseReader.java package test;import java.io.IOException;import java.io.InputStream;import java.util.Enumeration;import java.util.HashMap;import java.util.Map;import java.util.Properties;//propertiseļpublic class PropertiseReader {pri
package test; import java.io.IOException; import java.io.InputStream; import java.util.Enumeration; import java.util.HashMap; import java.util.Map; import java.util.Properties; //propertiseļ public class PropertiseReader { private static InputStream in = PropertiseReader.class.getResourceAsStream("factory.properties"); private static MapTestpropertise.javaKV; private static Properties factoryproperty; private PropertiseReader() { try{ factoryproperty=new Properties(); KV=new HashMap<>(); factoryproperty.load(in); Enumeration key= (Enumeration ) factoryproperty.propertyNames(); while(key.hasMoreElements()){ String K=key.nextElement(); String V=factoryproperty.getProperty(K); KV.put(K, V);} }catch(IOException e){} } private static PropertiseReader imp=new PropertiseReader(); public static Map mapgetElement(){ return KV; } }
package test; import java.util.Map; public class Testpropertise { public static void main(String[] args) { Mappro=PropertiseReader.mapgetElement(); System.out.println(pro.toString()); } }