6 System.loadLibrary("example");
7 } catch (UnsatisfiedLinkError e) {
8 System.err.println("Native code library failed to load. See the chapter on Dynamic Linking Problems in the SWIG Java documentation for help.\n" + e);
13 public static void main(String argv[]) {
15 // Call our gcd() function
18 int g = example.gcd(x,y);
19 System.out.println("The gcd of " + x + " and " + y + " is " + g);
21 // Call the gcdmain() function
22 String[] args = {"gcdmain","42","105"};
23 example.gcdmain(args);
25 // Call the count function
26 System.out.println(example.count("Hello World", 'l'));
28 // Call the capitalize function
29 String[] capitalizeMe = {"hello world"};
30 example.capitalize(capitalizeMe);
31 System.out.println(capitalizeMe[0]);