public List<Minterm> completeMinterm(Minterm minterm, String variables){
List<Minterm> minterms=new ArrayList<Minterm>();
Minterm m1=new Minterm();
Minterm m2=new Minterm();
for (int k = 0; k < minterms.size(); k++) {
for (int i = 0; i < variables.length(); i++) {
..
}
m1= minterms.get(k);
m1.addAtom(new Atom(variables.charAt(i),false));
m2 = minterms.get(k);
m2.addAtom(new Atom(variables.charAt(i),true));
..
}
}
我使用eclipse调试器发现错误,我不明白,为什么添加到的原子m2
也同时添加到m1
,运行此行时:
m2.addAtom(new Atom(variables.charAt(i),true));
任何想法为什么?