Java 中的 native 关键字是做什么用的? [英] What is the native keyword in Java for?

查看:34
本文介绍了Java 中的 native 关键字是做什么用的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在玩这个谜题(这是一个 Java 关键字问答游戏)时,我遇到了 native 关键字.

While playing this puzzle (It's a Java keyword trivia game), I came across the native keyword.

Java 中的 native 关键字是做什么用的?

What is the native keyword in Java used for?

推荐答案

native 关键字应用于方法,以指示该方法是使用 JNI(Java 本地接口)在本地代码中实现的.

The native keyword is applied to a method to indicate that the method is implemented in native code using JNI (Java Native Interface).

这篇关于Java 中的 native 关键字是做什么用的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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