I knew that in JAVA “native” is a special thing. It can do a lot of things. But I’m not able to read it right now. I don’t know how to… I knew it can call an other mathod in JAVA. My question is: can it call a private method? if it is a YES, then only in the same class or any other classes? if it can call other’s, then is it a problem that maybe it’s dangerous? that is, it broke the rules. Where can I get more about the NATIVE? can anybody show me a link?
Share
The JNI Programmer’s Guide and Specification says this in “10.9 Violating Access Control Rules”:
So the answers to your questions are:
Yes.
Any class.
The designers’ rationale for not attempting to enforce the normal Java access rules is clearly stated in the text quoted above. Yes it is potentially dangerous, but any use of JNI is potentially dangerous.