public interface OfficeAble{
public void start();
}
public class Excel implements OfficeAble {
public void start(){
System.out.println("excel run...");
}
}
public class Word implements OfficeAble {
public void start(){
System.out.println("word run...");
}
}
public class OfficeBetter {
public static void main(String[] args) {
try{
Class c1 = Class.forName(args[0]);
OfficeAble oa = (OfficeAble)c1.newInstance();
oa.start();
}catch(Exception e){
e.printStackTrace();
}
}
}