# Run 12-18-98 Test 1: Native.displayHelloWorld Hello world! Test 2: Native.toStringWithPrint Native[x=5,y=11,boolean_=true,byte_=19,char_=A,double_=3.1415926535, float_=10.2,int_=123456,long_=987654321,short_=12345, string_=This is a Java string] Test 3: Native.printLine In Native code, string is: This is from Java In Java code, string is: String from Native code Test 4: Native.printWXYZ [w = a Native String, x = 5, y = 11, z = 20] Test 5: Native.printObjectArray(Rectangle[3]) java.awt.Rectangle[x=0,y=0,width=0,height=0] java.awt.Rectangle[x=0,y=0,width=4,height=3] java.awt.Rectangle[x=0,y=0,width=8,height=6] Test 6: Native.printObjectArray(Native[2]) Native[x=5,y=11,boolean_=true,byte_=19,char_=A,double_=3.1415926535, float_=10.2,int_=123456,long_=987654321,short_=12345, string_=This is a Java string] Native[x=5,y=11,boolean_=true,byte_=19,char_=A,double_=3.1415926535, float_=10.2,int_=123456,long_=987654321,short_=12345, string_=This is a Java string] Test 7: Native.returnRectArray(3) java.awt.Rectangle[x=0,y=0,width=0,height=0] java.awt.Rectangle[x=0,y=0,width=5,height=10] java.awt.Rectangle[x=0,y=0,width=10,height=20] Test 8: Native.handleException Exception handled in Main.cpp: 5 Test 9: Native.causeException Exception in Native code not handled: java.lang.NoSuchFieldError: nonexistent Test 10: Native.pass2DByteArray(array2D) In native method printing 2-D byte array. Each element is then multiplied by 10 and updated. 0,0 = 1 0,1 = 2 0,2 = 3 1,0 = 4 1,1 = 5 1,2 = 6 In Java printing array that was changed by native method. 0,0 = 10 0,1 = 20 0,2 = 30 1,0 = 40 1,1 = 50 1,2 = 60 ********** Timings ********** Native countPrimes up to 1000000 .... 420 milliseconds Java countPrimes up to 1000000 .... 1523 milliseconds Native function calls 1000000 .... 931 milliseconds Java function calls 1000000 .... 150 milliseconds Native initialize array[10000] 1000 times .... 471 milliseconds Java initialize array[10000] 1000 times .... 3685 milliseconds Native callbacks into Java constructor 500 rectangles .... 150 milliseconds Java method calls to constructor 500 rectangles .... 151 milliseconds Native callbacks to Java void method 1000000 .... 1352 milliseconds Java calls to Native void function 1000000 .... 931 milliseconds