English 中文(简体)
Java核心图书馆继承的最佳范例是什么? [闭门]
原标题:What will be the best example of inheritance in core Java libraries? [closed]

I m preparing to interview and think that would be good if my answer for the question like "Explain inheritance in java with an example" will be real implementation from core java classes. There are many examples like Animals hierarchic or Shape but I think it would be more wisdom represent real situation and try answer for question - why this implementation good for this situation.
With that You show that you have good knowledge not just inheritance but and core Java :))) So what do you think about that??

Addition: Good another article: What can be the bad example of inheritance in Java? But in this article question is opposite to my.

最佳回答

The collections framework. It s good because it contains several kinds of inheritance:

  • List extends Collection, an example of interface inheritance
  • AbstractList implements List, which is implementation rather than inheritance, but is a related idea
  • ArrayList extends AbstractList, an example of class inheritance for implementation reuse

为了界定一种子类关系,可以找到一个实例说明的是阶级继承。 然而,如果你走了几条路, j子也包含:

  • GregorianCalendar extends Calendar
问题回答

我认为,每个班子都有

class Throwable is super class of all the Exceptions and Errors. And of course Throwable extends from Object.

我不知道你想要知道什么,但这里是一个继承例子:

Collection<T> extends Iterable <T>

易变接口使得能够使用实施该接口的每个数据结构都能够用于改进坡道。 收集接口是 Java大部分数据结构的超级接口。 汇款人可以返回收款机构,使执行更加灵活。 在目标中,内部数据代表可使用清单、清单或其他数据。 你们在改变执行时使用这一类别的其他地点,也不必 both。

http://www.ohchr.org。

因此,你想要讨论。

我认为,对于雇主来说,重要的是,你可以使用 Java,而不是你知道它是如何支持APIC的。 公益物只是使用固定设计概念,而不是真正特殊。 作为专业方案者,您应了解并了解如何使用这些技术,但不知道其他方案者使用这些技术。

你还可以提到<代码>String的类别,如果你需要的话,这些类别不能延伸到,以表明你们知道如何阻止继承。





相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签