public class ReactionTest { static Reaction[] re = new Reaction[18]; // TODO Auto-generated method stub static Reaction hgo=new Reaction("2HgO","Hg","点燃",null); static Reaction mgo=new Reaction("Mg","O2","点燃",null); static Reaction fe3o4=new Reaction("3Fe","2O2","点燃",null); static Reaction cuo=new Reaction("2Cu","O2","加热",null); static Reaction al2o3=new Reaction("4Al","3O2","点燃",null); static Reaction h2o=new Reaction("2H2","O2","点燃",null); static Reaction p2o5=new Reaction("4P","5O2","点燃",null); static Reaction so2=new Reaction("S","O2","点燃",null); static Reaction co2=new Reaction("C","O2","点燃",null); static Reaction co=new Reaction("2C","O2","点燃",null); static Reaction coco2=new Reaction("2CO","O2","点燃",null); static Reaction c2h5oh=new Reaction("C2H5OH","3O2","点燃",null); static Reaction k2mno4=new Reaction("2KMnO4",null,"加热",null); static Reaction h2o2=new Reaction("h2o2",null,null,"二氧化锰"); static Reaction h2od=new Reaction("2H2O",null,"通电",null); static Reaction caoh2=new Reaction("CaO","H2O",null,null); static Reaction h2co3=new Reaction("H2O","CO2",null,null); static Reaction caco3=new Reaction("CaCO3",null,"高温",null); public static void main(String[] args) { re[0]=hgo; re[1]=mgo; re[2]=fe3o4; re[3]=cuo; re[4]=al2o3; re[5]=h2o; re[6]=p2o5; re[7]=so2; re[8]=co2; re[9]=co; re[10]=coco2; re[11]=c2h5oh; re[12]=k2mno4; re[13]=h2o2; re[14]=h2od; re[15]=caoh2; re[16]=h2co3; re[17]=caco3; } public static boolean get() { String str=Frame.text.getText(); String str1=Frame.text1.getText(); String str2=Frame.saveValue; String str3=Frame.saveValue1; System.out.println(str+str1+str2+str3); Reaction[] test = new Reaction[1]; Reaction Test=new Reaction(str,str1,str2,str3); test[0]=Test; System.out.println(re[0]); System.out.println(test[0]); boolean c = false; for(int i=0;i<re.length;i++) { Reaction taget=re[i]; if() { c=true; System.out.println(c); break; }else{ c=false; } } return c; } }