Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 2

SRM INSTITUTE OF SCIENCE AND TECHNOLOGY 6) Which exception prints an exception and the stack race

RAMAPURAM CAMPUS SET 2 A) Throw() B) FatalError()


DEPARTMENT OF INFORMATION TECHNOLOGY
C) ExceptionDescribe() D) ExceptionOccured()
Cycle Test - I
15IT411J – INTEGRATIVE PROGRAMMING AND TECHNOLOGY
7) The corresponding c code in JNI for the java code: synchronized(obj)
Year/Sem : IV/VIII Max Mark: 50
Class : IT Duration : 1hr 30 mins A) env->MonitorEntry(obj) B) env->MonitorEnter(obj)
Date : /08/2018 C) (*env)->MonitorEnter(env, obj) D)(*env)->MonitorEntry(env, obj)
PART – A (10 X 1 = 10)
Answer ALL Questions
8) What is the next step after creating the java file with native method?
1) The extension of the file after compiling c code and generating native
A) Creating .dll file B) Creating static block in java file
library
C) Creating and building C project D) Creating the header file
A) .dll B) .class C) .java D) .h

9) Which option tells the compiler to generate the DLL?


2) Non-static methods are also called as
A) M32 B) Shared C) Alias D) Add-stdcall
A) Instance methods B) Static methods
C) Class object D) Native methods
10) Returns the number of Unicode characters in the string.
A) GetStringLength B) GetStringsLength
3) Every JNI native method receives a special argument as its
C) GetStringUTFLength D) GetStringContext
firstparameter
PART – B (4 X 4 = 16)
A) JNIExport B) JNICall C) JNIEnv D) jclass Answer any FOUR questions

4) Type signature of Boolean 11) Write the machine generated header file code for the following java code:
A) Z B) D C) F D) J
package jni_str_Pkg;
class JNI_strclass
5) To convert to Unicode format string in UTF {
public static String native reverse(String str)
A) GetStringUTFChars() B) ReleaseStringUTFChars() public int[] native Sorting(int a[], float n)
C) ReleaseStringChars() D) getStringChars() /*body of class*/
}
12) List out the functions of JNIEnv argument? B) Explain in detail about implementing the DLL? ( 12 marks)

13) Write &Draw the steps for creating JNI program?


*****ALL THE BEST*****
14) State cygwin and explain the steps of cygwin ?

15) Short notes on calling native method?

16) Explain about passing and using java objects?

PART – C (2 X 12 = 24)
Answer ALL Questions

17) A) ) i) Explain in detail about JNI and write the steps for creating JNI
concepts (5 marks)

ii) Write a program using JNI concept (7 marks)

1) Define a java main class, with one native method which takes array
as an argument “native int maximumOccurence(int arr[])”.
2)Define a C / C++ code to find the maximum occurrence of element in
an array and return the number of occurrences to java.

(OR)

B) i) Brief notes on monitor entry and exit with its necessary snippet? (6 marks)

ii) Brief notes on monitor wait and notify with its necessary snippet? (6
marks)

18) A) i) State the different JNI exception handling functions? (6 marks)

ii) Write the sample code by using exception handling functions(JNI & C
code)? ( 6 marks)

(OR)

You might also like