当前位置:网站首页>Role of native keyword

Role of native keyword

2022-06-28 04:42:00 Don't want to be a programmer

stay Thread Class Yes start0; Insert picture description here
There is a class without a method body start0(), It's not supposed to be . It's used here native keyword .
native The function of keywords is :

  • Call the underlying code ( That is to say, when Thread Class start0 After method , The execution of the program is no longer subject to java Code control , Will call the underlying C++ Etc )
  • This keyword modifies the method and does not provide an implementation body , It goes into the local method stack , By calling JNI Interface implements the use of other language code and code base .
  • There is a specially opened area in the memory :Native Method Stack, registration Native Method .
原网站

版权声明
本文为[Don't want to be a programmer]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/179/202206280356593272.html