package javatech.jni22;

/** Demonstrates passing a Java string to a native method. **/
public class StringExample
{
    // Load the native library.
    static { System.loadLibrary ("NativeString"); }

    // Declare the native methods.
    public native String nativeProcessString (String s);

    /** Constructs the StringExample object and calls the native method. **/
    public StringExample () {

	// Call the nativeProcessString method.
	String s = "test me";
	String back = nativeProcessString (s);
	System.out.println ("input string was '" + s + "'");
	System.out.println ("output string is '" + back + "'");
    } // ctor


    /** Runs the demo. **/
    public static void main (String[] args) {
	new StringExample ();
    } // main
} // StringExample
