【问题标题】:hashCode, notify and wait are implemented using which programming language?hashCode、notify 和 wait 是使用哪种编程语言实现的?
【发布时间】:2017-02-07 16:40:40
【问题描述】:

我在java中检查Object类,发现hashCode、notify、wait等少数方法是native方法。

public final native void wait(long timeout) throws InterruptedException;

这些方法不是用java语言实现的吗? 使用其他一些编程语言(我猜是 C)来实现这些方法?

请帮助我在这里获得清晰的图片。

谢谢, 高拉夫

【问题讨论】:

标签: java native wait hashcode notify


【解决方案1】:

他们必须使用 C,因为 hashCode() 在 Objects 标头上起作用。

notify/wait 使用其他任何方式都不可用的系统调用。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-04-06
    • 1970-01-01
    • 2011-09-12
    • 1970-01-01
    • 2010-09-18
    • 1970-01-01
    • 2015-12-28
    • 2018-12-26
    相关资源
    最近更新 更多