首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > J2EE开发 >

Document能够作为成员变量的类型么?解决方法

2012-03-09 
Document能够作为成员变量的类型么?在eclipse中写了如下代码:public class JAXPSample{private string fil

Document能够作为成员变量的类型么?
在eclipse中写了如下代码:
public class JAXPSample{
  private string filename = “books。xml”;
  private Document doc = null;
  
  public static void main (String【】 args){
   
  JAXPSample application = new JAXPSample();

  }

}
提示说:Document cannot be resolved to a type。
本人初学者,希望知道的能够指点一二。谢谢!!!

[解决办法]
要根据你所准备使用的XML解析工具来定,这两种既有可能是对的,也有可能是错的。

网上Google点相对完整的代码吧,就不用自己纠结了。

热点排行