IntelliJ Java IDE
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes about native method Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Professional Certification » Programmer Certification (SCJP/OCPJP)
Reply Bookmark "about native method" Watch "about native method" New topic
Author

about native method

devi nachimuthu
Greenhorn

Joined: Jan 07, 2003
Posts: 10
Why might you define a method as native...?
1)To get to access hardware that java does not know about
2) To define a new data type such as an unsigned integer
3) To write optimised code for performance in a language such as c/c++
4) To overcome the limitation of the private scope of a method
My answer is 3. But the given answers are 1 and 3. Is 1 is also correct about native method...?
Thanks
Paul A
Ranch Hand

Joined: Aug 25, 2000
Posts: 44
Yes, 1 is also a correct option.
For eg, you might want to access a device driver that's written in c/c++. You can do it using JNI.
HTH,
Paul.
------------------
http://pages.about.com/jqplus
Get Certified, Guaranteed!


<A HREF="http://pages.about.com/jqplus" TARGET=_blank rel="nofollow">http://pages.about.com/jqplus</A> <BR>Get Certified, Guaranteed!
 
 
subject: about native method
 
Threads others viewed
Webligic example
Doubt in native
MARQUES exam 2, q 5
native methods
Marcus Green mock exam - 2 #5
WebSphere development made easy
without the weight of IBM tools
http://www.myeclipseide.com