The great merge
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@4141 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
6fcc22a1f8
commit
516036631c
1508 changed files with 125983 additions and 44037 deletions
29
SWIG/Examples/test-suite/java/dynamic_cast_runme.java
Normal file
29
SWIG/Examples/test-suite/java/dynamic_cast_runme.java
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
|
||||
import dynamic_cast.*;
|
||||
|
||||
public class dynamic_cast_runme {
|
||||
static {
|
||||
try {
|
||||
System.loadLibrary("dynamic_cast");
|
||||
} catch (UnsatisfiedLinkError e) {
|
||||
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);
|
||||
System.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String argv[])
|
||||
{
|
||||
Foo f = new Foo();
|
||||
Bar b = new Bar();
|
||||
|
||||
Foo x = f.blah();
|
||||
Foo y = b.blah();
|
||||
|
||||
// Note it is possible to downcast y with a Java cast.
|
||||
String a = dynamic_cast.do_test((Bar)y);
|
||||
if (!a.equals("Bar::test")) {
|
||||
System.err.println("Failed!");
|
||||
System.exit(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue