A method with no statements inside and ends with a semicolon

This question already has an answer here:

  • What is the native keyword in Java for? 11 answers

  • That's a declaration for a native method, indicated by the native modifier, as explained in the Java Language Specification, section §8.4.3.4 native Methods .

    You won't find its implementing code in Java, it's referring to code that's either in the C libraries that are part of the implementation of the JDK in use, or part of a native library bundled with the code you're studying. Refer to the JNI documentation to understand how this gets called from a Java program.


    The native keyword in Java signifies the method is written in another language. See this exact question: What is the native keyword in Java for?


    the keyword native states that this method's implementation comes from a native language like c/cpp etc via JNI

    A common example: a couple of methods in java.lang.Object class are implemented in native language.

    链接地址: http://www.djcxy.com/p/96828.html

    上一篇: 为什么currentThread方法没有方法BODY?

    下一篇: 内部没有语句并以分号结尾的方法