public static void main(String[] args) throws Exception {
/*
* 实现接口
*
*/
Properties p = new Properties();
File file = new File("usb.properties");
FileInputStream fis = new FileInputStream(file);
p.load(fis);
NetBook book = new NetBook();
for(int i=1;i<=p.size();i++){
String usb = p.getProperty("usb"+i);
Class clazz = Class.forName(usb);
Usb u = (Usb)clazz.newInstance();
book.run();
book.useUSB(u);
}
}
}