Description: Interfacing With C From Java With JNI: Part 2
When passing or returning values in the form of parameters from Java to C or vice versa, we have to follow a mapping system. Let's assume you want to pass an integer parameter from Java to C. Firstly, you just check the mappings (which are in form of a table) and note the corresponding mapping for the integer data type. Next, you pass your parameter from you Java Code as a normal integer but collect it from your C code as the data type which corresponds to the integer parameter in the mappings.