home *** CD-ROM | disk | FTP | other *** search
Java Source | 1997-07-23 | 472 b | 17 lines |
- class NativeExample {
- public static native void Display(String str);
- public static native long Sub(long a, long b);
- public static native void Fibonacci(int i);
-
- static {
- System.loadLibrary("native");
- }
-
- public static void main(String args[]) {
- Display("5 - 2 = " + Sub( 5, 2) + "\n");
- for(int i=0; i<args.length; i++)
- /* call a native method from java */
- Fibonacci(Integer.parseInt(args[i], 10));
- }
- }
-