Created
February 4, 2014 10:45
-
-
Save ashumeow/8801467 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Callbacks { | |
private native void nativeMethod(int depth); | |
private void callback(int depth) //funtion NAME (parameter 1, 2, ....) | |
{ | |
// statements | |
if (depth < 5) | |
{ | |
//calling the function | |
System.out.println("In Java, depth = " + depth + ", about to enter C"); | |
nativeMethod(depth + 1); | |
System.out.println("In Java, depth = " + depth + ", back from C"); | |
} else | |
System.out.println("In Java, depth = " + depth + ", limit exceeded"); | |
} | |
public static void main(String args[]) | |
{ | |
Callbacks c = new Callbacks(); | |
c.nativeMethod(0); | |
} | |
static | |
{ | |
System.loadLibrary("MyImpOfCallbacks"); | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment