Guys,
Remember that if you declare a method as native, then you cannot provide an implementation.
So it has to be like :
native void foo();
Trying:
native void foo(){}
would give a compilation error, because the implementation is supposed to be in a "native" code like C/C++.
Mind you, native void foo(); will compile, but at run time, the native implementation must be available or else there will be a runtime error.
Readup on JNI to see what it takes to implement java methods in native c/c++ code. The details are not necessary for the
SCJP exam, but its worth knowing the basics.
Check this link for a very brief introduction to JNI.
http://www.geocities.com/kongwenyu/jni.html - Ortimus