⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 config.java

📁 用实例描述了factory设计模式。 并且该实例都已编译通过
💻 JAVA
字号:
package cn.edu.hunnu.factory;

import java.io.File;
import java.io.FileInputStream;
import java.util.Properties;

public class Config {
	private static Properties p;//store the relationship of product and factory

	public static void init() {
		try {
			File f = new File("config.properties");//construct a file from config.properties 
			FileInputStream fs = new FileInputStream(f);
			p = new Properties();
			p.load(fs);//load the  relationship of product and factory from f
			fs.close();
		} catch (Exception e) {
			System.out.println(e.getMessage());
		}
	}
	public  static Properties getP(){
		return p;
	} 
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -