用接口,ClassA和ClassB都继承自IClass
public IClass Test1;
if   (strType   ==   "1") 
                { 
                        Tset1=   new   ClassA(); 
                } 
            else 
                { 
                        Test1=   new   ClassB(); 
                }