什么是子类化? [英] What is subclassing?

查看:92
本文介绍了什么是子类化?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是java的新手,我试图创建XML文档并一遍又一遍地克隆此文档的特定节点(减去textnode)。有人回答了我,说我应该继承节点的子类并覆盖克隆。所以我的问题是什么是子类化?

I am new to java and I am trying to create an XML document and clone a specific node (minus the textnode) of this document over and over again. Someone answered me and said that I should subclass the node and override the cloning. So my question is what is sub-classing?

推荐答案

@Charlie Martin解释了子类化的含义。

@Charlie Martin has explained what subclassing means.

但是,不清楚您是否得到了很好的建议。如果要通过在内存中组装DOM来创建XML文档,则更好的方法是使用静态方法创建一个助手类,该类执行需要执行的DOM节点操作序列。

However, it is not clear that you've been given good advice. If you are creating the XML document by assembling a DOM in memory, a better approach would be to create a helper class with static methods that perform the sequence of DOM node operations that you need to do.

这篇关于什么是子类化?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆