The JavaTM Tutorial
Previous Page Lesson Contents Next Page Start of Tutorial > Start of Trail Search
Feedback Form

Trail: Java Native Interface

Lesson: Summary of the JNI

Congratulations! You have learned a great deal about the JNI. To help you remember everything you have learned, this section summarizes the JNI functions and mapping types.

Mapping Between JNI and Native Types

The following two tables summarize how Java types map to native types and the rules for encoding Java types in native signatures.

Primitive Types and Native Equivalents
Java Type Native TypeSize in bits
boolean jboolean8, unsigned
byte jbyte8
char jchar16, unsigned
short jshort16
int jint32
long jlong64
float jfloat32
double jdouble64
void voidn/a

Encoding for Java Type Signatures
Signature Java Programming Language Type
Z boolean
B byte
C char
S short
I int
J long
F float
D double
L fully-qualified-class ; fully-qualified-class
[ type type[]
( arg-types ) ret-type method type

JNI String Handling Functions

JNI Array Handling Functions

JNI Method Handling Functions

JNI Member Variable Handling Functions

JNI Exception Handling Functions

JNI Local and Global Reference Handling Functions

JNI Thread Synchronization Functions


Previous Page Lesson Contents Next Page Start of Tutorial > Start of Trail Search
Feedback Form

Copyright 1995-2002 Sun Microsystems, Inc. All rights reserved.