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

📄 env.java

📁 用mvc实现购物车,简单使用,欢迎大家来下载啊
💻 JAVA
字号:
package com.xaccp.fileRead;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

public class Env extends Properties{
	private static Env instance = null;
	private Env(){
		InputStream is=getClass().getResourceAsStream("/db.properties");
		try {
			load(is);
		} catch (IOException e) {
			e.printStackTrace();
			System.out.println("属性文件没有找到!");
		}
	}
	private static synchronized void makeInstance(){
		if(instance == null){
			instance = new Env();
		}
	}
	
	public static Env getInstance(){
		if(instance != null){
			return instance;
		}else{
			makeInstance();
			return instance;
		}
	}	
}

⌨️ 快捷键说明

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