请那位位朋友告诉我以下语句哪里有问题,循环内的变量怎么控制,CATIElement我一定要在下个循环语句用很矛盾啊,请帮我一下吧谢谢 package com.KCCB.app; import java.util.Iterator; public class CreateXmlNBH { public CreateXmlNBH(){ } public String createDaeXMLFile(OutputStream os) throws UnsupportedEncodingException{ Element HVTRElement = document.addElement(“HVTR”);
Element CATIsElement = HVTRElement.addElement(“CATIs”); while(iterator.hasNext()) { / I 循环 fxqdejy = (FxqDejy)iterator.next(); |
|
请帮忙看看
|
|
25分 |
变量有活动空间知道么?就是所谓的局部变量和全局变量…
基础一定要掌握啊… |
25分 |
Element CATIElement = null;
while(iterator.hasNext()) { / I 循环 fxqdejy = (FxqDejy)iterator.next(); … |
关注
|
|
多谢各位,转到java时间不长,见笑了,我把这个错误的完整代码全贴上吧,希望能纠正我的错误
package com.KCCB.app; import java.io.File; import com.KCCB.db.*; import java.io.OutputStream; public class CreateXmlNBH { public CreateXmlNBH(){ } public String createDaeXMLFile(OutputStream os) throws UnsupportedEncodingException{ String returnvalue=”success”; FxqNumDAO faxnumdao = new FxqNumDAO(); Document document = DocumentHelper.createDocument(); Element HVTRElement = document.addElement(“HVTR”); Element RBIFElement = HVTRElement.addElement(“RBIF”); fxqdejy = (FxqDejy)iterator.next(); Element RINMElement = RBIFElement.addElement(“RINM”); Element CATIsElement = HVTRElement.addElement(“CATIs”); while(iterator.hasNext()) { //CATI 循环 fxqdejy = (FxqDejy)iterator.next(); |
|
Element TSDTElement = TSDTsElement.addElement(“TSDT”); Element TBIFElement = TSDTElement.addElement(“TBIF”); Element TSIFElement = TSDTElement.addElement(“TSIF”); Element TCIFElement = TSDTElement.addElement(“TCIF”); try{ /*public int formatXMLFile(String filename){ int returnValue = 1; return returnValue; /*public static void main(String[] args) { }*/ } |
|
关注
|