- import java.util.*;
- import java.lang.reflect.*;
- import java.io.*;
- class ReflectTest3
- {
- public static void main(String[] args) throws Exception
- {
- InputStream is = new FileInputStream("info.properties");
- Properties prop = new Properties();
- prop.load(is);
- is.close();
- String ClassName=prop.getProperty("ClassName");
- Collection<String> collection=(Collection<String>)Class.forName(ClassName).newInstance();
- collection.add("a");
- collection.add("b");
- collection.add("c");
- collection.add("a");
- System.out.println(collection.size());
- }
- }
复制代码
这段代码还有哪里需要添加线程,请大神帮忙看下., |
|