Code Source: http://www.java2s.com/Code/Java/XML/ParsingXMLFileswithSAX.htm
Anonymous inner class description: http://stackoverflow.com/questions/4216093/writing-a-class-while-instantiating-it
The anonymous inner classes is very useful in some situation. For example consider a situation where you need to create the instance of an object without creating subclass of a class and also performing additional tasks such as method overloading
本文介绍了一个使用SAX解析XML文件的Java示例程序。通过匿名内部类的方式实现了DefaultHandler,用于处理XML文件中的NAME标签,并打印出每个PERSON的名字。
5538

被折叠的 条评论
为什么被折叠?



