nerdexam
Android

OA0-002 · Question #79

The following JNIProb.java has been compiled, and the javah command has been run to create the header file JNIProb.h. Which is the correct code that goes into (1) of the C/C++ source file JNIProb.c…

The correct answer is B. jint JNICALL Java_JNIProb_add(JNIEnv*env, jobject o, jint a, jint b). See the full explanation below for the reasoning.

Question

The following JNIProb.java has been compiled, and the javah command has been run to create the header file JNIProb.h. Which is the correct code that goes into (1) of the C/C++ source file JNIProb.c created in this way?

Exhibit

OA0-002 question #79 exhibit

Options

  • Aint JNICALL Java_JNIProb_add(JNIEnv*env, jobject o, inta, intb)
  • Bjint JNICALL Java_JNIProb_add(JNIEnv*env, jobject o, jint a, jint b)
  • Cjint JNICALL add(JNIEnv *env. jobject o. int a. int b)
  • Djint JNICALL addfJNIEnv *env, jobject o. jint a. jint b)

How the community answered

(37 responses)
  • A
    14% (5)
  • B
    76% (28)
  • C
    8% (3)
  • D
    3% (1)

Community Discussion

No community discussion yet for this question.

Full OA0-002 Practice