What is a native method

A native method is a method that is implemented in a language other than Java.

Showing Answers 1 - 4 of 4 Answers

ramu

  • Mar 10th, 2006
 

     native

?         Can be applied to methods only. (static methods also)

?         Written in a non-Java language, compiled for a single machine target type.

?         Java classes use lot of native methods for performance and for accessing hardware Java is not aware of.

?         Native method signature should be terminated by a ?;?, curly braces will provide a compiler error.

?         native doesn?t affect access qualifiers. Native methods can be private.

?         Can pass/return Java objects from native methods.

oam

  • Aug 11th, 2007
 

Informs the compiler that the method has been used in a non-java platform and used only with the methods.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions