public class Mod{
public static void main(String argv[]){
}
public static native void amethod();
}
=========================================================
Here the method is declared as native.The native key
word alerts the
compiler that the method will be defined externally.Native methods will not
conatin any coding in
Java language.
This code will compile and run with out any error.But if you try to use the
method in another class,during run time it will throw
exception "UnsatisfiedLinkError",since JVM doesn't know how to find
aMethod().
So before using native methods,load the library file containg the method
definition for aMethod()developed in a language other than Java like C/C++.
You can do this by System.loadLibrary("moose.dll");
Hope this will help you.
Thanks
Chandrasekhar S.