public static void getSettings(){ try { File file = new File("config.properties"); Properties p = new Properties(); FileInputStream fileInput = new FileInputStream(file); //Import moduleNames = p.getProperty("moduleNames").split(""); moduleData = ??? //I don't know how to convert String to String[][] } catch (Exception e){ e.printStackTrace(); } }
这是设置属性的另一个函数:
public static void writeFile(String[][] mD, String[] mN){ try{ Properties p = new Properties; File file = new File("config.properties");
p.setProperty("moduleData", Arrays.deepToString("mD")); p.setProperty("moduleNames", Arrays.toString("mN")); //...further more code to flush the data out } catch (Exception e){ e.printStackTrace(); }
我是一名优秀的程序员,十分优秀!