LogicElement 是个保存内容的类 public LogicElement[] initPAnDArch(){
LogicElement[] le = new LogicElement[LENUM];
int[] tempCcab = new int[LECCABNUM];
int[] tempScab = new int[LESCABNUM];
String[] tempInput = new String[LEINPUTNUM];
String[] tempOutput = new String[LEOUTPUTNUM];
for(int i = 0; i < LENUM; i++){
le[i] = new LogicElement();
le[i].setCarryIn(null);
le[i].setCarryOut(null);
le[i].setClock(null);
le[i].setCcabIndex(tempCcab);
le[i].setScabIndex(tempScab);
le[i].setInput(tempInput);
le[i].setOutput(tempOutput);
le[i].setCarryIn(null);
le[i].setCarryOut(null);
}
return le;
}用以上办法初始化后 内容还在 如何恢复到null 指向空?
LogicElement[] le = new LogicElement[LENUM];
int[] tempCcab = new int[LECCABNUM];
int[] tempScab = new int[LESCABNUM];
String[] tempInput = new String[LEINPUTNUM];
String[] tempOutput = new String[LEOUTPUTNUM];
for(int i = 0; i < LENUM; i++){
le[i] = new LogicElement();
le[i].setCarryIn(null);
le[i].setCarryOut(null);
le[i].setClock(null);
le[i].setCcabIndex(tempCcab);
le[i].setScabIndex(tempScab);
le[i].setInput(tempInput);
le[i].setOutput(tempOutput);
le[i].setCarryIn(null);
le[i].setCarryOut(null);
}
return le;
}用以上办法初始化后 内容还在 如何恢复到null 指向空?
解决方案 »
- description The server encountered an internal error () that prevented it from f
- 关于异常的处理
- 用递归算法实现费博那契数列的问题
- uddi与wsdl关系
- 一起讨论:table标签怎么定制? JSP 标签 taglib BodyTagSupport TagLibraryInfo <table> <tr> <td> struts
- 请教高手为什么我从SEVLET中跳转到查询的JSP是出现这样的问题???
- 一个聊天程序,如何实现在同一个ServerSocket连接下的多个Socket之间进行消息发送;
- !!!求j2ee的入门书
- 棘手的问题,快来看
- 怎么修改MyEclipse 数据库逆向Hibernate工程的数据类型?
- JMX 连接管理weblogic出现以下问题该如何解决
- java使用连接池连接oracle 存储执行5分多就超时
private String carryIn;
private String shiftIn;
private String clock;
private int[] ccabIndex;
private int[] scabIndex;
private String[] input;
private String[] inter;
private String[] output;
private String carryOut;
private String shiftOut;
private String[] configData;
private boolean used;
}
le[i].setCarryIn(null);
le[i].setCarryOut(null);
le[i].setClock(null);
le[i].setCcabIndex(tempCcab);
le[i].setScabIndex(tempScab);
le[i].setInput(tempInput);
le[i].setOutput(tempOutput);
le[i].setCarryIn(null);
le[i].setCarryOut(null);实在不明白你的setNULL有什么用,你不set它本身也是NULL。
你new出来的这个对象,本身就不是你已经存东西的对象,重新设置已经存数据那个对象不叫初始化吧。
int的初始化,随便set个1或者0或者其他。
你或者应该把你那个 LogicElement的数据传进来,再重置它。
int[] tempScab = new int[LESCABNUM];
String[] tempInput = new String[LEINPUTNUM];
String[] tempOutput = new String[LEOUTPUTNUM];
以上定义并初始化的数组变量都是方法内的局部变量,方法结束后都不存在了。怎么调用啊?