jni

JNI method and constructor signature cheat sheet

August 6, 2012   ·   0 Comments

 

I just started learning LS2J, and the JNI signatures that are required when getting methods and constructors are a bit hard to understand. Here are my findings so far.

 

  • B=byte
  • C=char
  • D=double
  • F=float
  • I=int
  • J=long
  • S=short
  • V=void
  • Z=boolean
  • Lfully-qualified-class=fully qualified class
  • [type=array of type>
  • (argument types)return type=method type. If no arguments, use empty argument types: (). If return type is void (or constructor) use (argument types)V.

Examples

constructor:(String s)translates to:(Ljava/lang/String;)V

method:String toString()translates to:()Ljava/lang/String;

method:long myMethod(int n, String s, int[] arr)translates to:(ILjava/lang/String;[I)J

shareShare on FacebookShare on Google+Share on LinkedInEmail this to someonePrint this pageBuffer this pageDigg thisFlattr the authorShare on RedditPin on PinterestShare on StumbleUponShare on TumblrTweet about this on Twitter

By


Readers Comments (0)


You must be logged in to post a comment.

PowenKo’s Online Store

powenko_arduinoBook
Android7

Amazon

adsbygoogle

Recent Posts

Categories

Amazon