Native method in java and javanative Method

Source: Internet
Author: User

Native method in java and javanative Method

Native is used for joint development with C ++! Java development is not required!

The native keyword indicates that this method is a native function, that is, this method is implemented in C/C ++ and compiled into a DLL, which is called by java. The implementation of these functions is in the DLL, And the JDK Source Code does not contain them. You should not see them. They are also different for different platforms. This is also the underlying mechanism of java. In fact, java calls different native methods on different platforms to access the operating system.

  • Native is used for java and other languages (such as c ++) for collaboration, that is, the implementation of native functions is not written in java.
  • Since it is not java, don't worry about its source code.


Native means to notify the operating system. You must implement this function for me because I want to use it. Therefore, functions with native keywords are implemented by the operating system and can only be called in java.

Java is a cross-platform language. Since it is a cross-platform language, the cost is to sacrifice some control over the underlying layer, while java must implement control over the underlying layer, we need help from other languages. This is the role of native.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.