As shown below:
public static String getConfig(String key) { Properties pros = new Properties(); String value = ""; try { pros.load(new InputStreamReader(Object.class.getResourceAsStream("/properties.properties"), "UTF-8")); value = pros.get(key).toString(); } catch (IOException e) { log.error(e.getMessage()); } return value; }The above is the full content of the solution to the Java garbled Chinese code when reading properties configuration files brought to you. I hope everyone will support Wulin.com more~