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

📄 configfactory.java

📁 java编程源代码
💻 JAVA
字号:
/*01*/import java.io.*;
/*02*/import java.util.*;
/*03*/import java.lang.reflect.*;
/*04*/public class ConfigFactory
/*05*/{
/*06*/	  public static IFruit GetObj() throws Exception
/*07*/	  {	  	
/*08*/	  	  FileInputStream str=new FileInputStream("a.property");
/*09*/	  	  InputStream in =new BufferedInputStream(str);
/*10*/	  	  Properties p = new Properties();
/*11*/        p.load(in);
/*12*/        String strPath=p.get("classpath").toString();
/*13*/        Class c = Class.forName(strPath);
/*14*/        Object obj=c.newInstance();        
/*15*/        IFruit ft=(IFruit)obj;
/*16*/        in.close();        
/*17*/        return ft;
/*18*/	  }
/*19*/}

⌨️ 快捷键说明

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