All Matches
Solution Library
Expert Answer
Textbooks
Search Textbook questions, tutors and Books
Oops, something went wrong!
Change your search query and then try again
Toggle navigation
FREE Trial
S
Books
FREE
Tutors
Study Help
Expert Questions
Accounting
General Management
Mathematics
Finance
Organizational Behaviour
Law
Physics
Operating System
Management Leadership
Sociology
Programming
Marketing
Database
Computer Network
Economics
Textbooks Solutions
Accounting
Managerial Accounting
Management Leadership
Cost Accounting
Statistics
Business Law
Corporate Finance
Finance
Economics
Auditing
Ask a Question
Search
Search
Sign In
Register
study help
computer science
advanced java programming
Questions and Answers of
Advanced Java Programming
How do you determine the name of a JNI function given a native method name?
Which of the following files contains native functions needed to interact with Java code?(a) lib.h(b) jni.h(c) native.h(d) functions.h
Describe the parameters of a mapped JNI function?
Java Object is represented in native code as(a) NativeObject(b) Object(c) JniObject(d) Jobject
Describe the procedure to create a shared library in C/C++.
Which of the following macros is used to specify the calling and linkage convention of both Java native methods and their implementations.(a) JNIEXPORT(b) JNICALL(c) Both a) and b)(d) None of the
Distinguish between C and C++ pointer representation.
The primary interface to Java language is(a) Env(b) PrimaryEnv(c) JNIEnv(d) PInterface
Describe the steps required to develop a JNI application that uses package.
Which of the following options is used to create a shared library?(a) -common(b) -s(c) -shared(d) -shareAll
How are Java types represented in JNI and where are they defined?
What will the mangled signature be if the signature of a function is “void f()”?(a) ()V(b) (I)V(c) V()(d) ()I
Show how you pass primitive arrays to a native method.
Which of the following environment variables specify the location of the library?(a) LD_LIBRARY_PATH(b) LIBRARY_PATH(c) LD_JNI_PATH(d) JNI_LIBRARY_PATH
How is a Java string passed to a native method?
How do you access Java code from primitive code?
How many array types are there in JNI?(a) 7(b) 8(c) 9(d) 10
What happens when we pass an object array to a native method?
A boolean in Java is converted to C/C++ as(a) Int(b) Short(c) Signed char(d) Unsigned char
Describe the steps required to create Java object from native code.
A byte in Java is converted to C/C++ as(a) Int(b) Short(c) Unsigned short(d) Signed char
Describe how exceptions are handled in JNI.
A byte in Java is converted to C/C++ as(a) Int(b) Short(c) Unsigned short(d) Signed char
What will the mangled signature be if the signature of a function is “void f(int, int[])”?(a) V(I[I)(b) (II)V(c) ([II)V(d) (I[I)V
A Java type boolean is mangled in JNI as(a) Z(b) B(c) C(d) S
A Java type byte is mangled in JNI as(a) Z(b) B(c) C(d) S
Which of the following is equivalent to delete in C++?(a) ReleaseStringUTFChars()(b) DeleteStringUTFChars()(c) Release()(d) FreeStringUTFChars()
Which of the following JNI functions is used to create a new string?(a) New()(b) NewUTF()(c) NewStringUTF()(d) NewStr()
What will the mangled signature be if the signature of a function is “void f(int, double)”?(a) (DI)V(b) V(ID)(c) (ID)V(d) (IV)D
Which of the following JNI methods is used to get array elements?(a) GetElements()(b) GetIntArrayElements()(c) IntArrayElements()(d) Elements()
Which of the following JNI methods is used to get a reference to an object’s class?(a) GetObjectClass()(b) GetClass()(c) Class()(d) ObjectClass()
Which of the following JNI methods is used to create new Java objects?(a) New()(b) Object()(c) NewObject()(d) NewJavaObject()
Which of the following functions is used to determine if an error has occurred or not?(a) ExceptionOccurred()(b) ExceptionCheck()(c) Both a) and b)(d) None of the above
Which of the following methods is used to describe an exception?(a) ExceptionDescribe()(b) Describe()(c) Exception()(d) JNIExceptionDescribe()
Which of the following throws an exception if an error occurs?(a) CallIntMethod()(b) CallVoidMethod()(c) Both a) and b)(d) Neither a) nor b)
What is the full form of AWT?(a) All Windows Tools(b) Abstract Window Toolkit(c) All Writing Tools(d) Absolute Window Toolkit
What is a layout manager and what are the different types of layout managers available?
Which of the following methods is used to determine the key pressed?(a) getKey()(b) getActionKey()(c) getModifier()(d) getSource()
How are the elements of a borderLayout organized?
Which of these events is generated when a button is pressed?(a) MouseEvent(b) KeyEvent(c) PressEvent(d) ActionEvent
Which containers may have a menu bar?
When two or more objects are added as listeners for the same event, which listener is first invoked to handle the event?(a) The first object that was added as listener.(b) The last object that was
What is the difference between choice and the List?
Which of the following components generates action events?(a) Buttons(b) Labels(c) Check boxes(d) Windows
What advantage do Java’s layout managers provide over traditional windowing systems?
Suppose you want to have an object eh handle the TextEvent of a TextArea object t. How should you add eh as the event handler for
What is the preferred way to handle an object’s events in Java 2?(a) Override the object’s handleEvent( ) method.(b) Add one or more event listeners to handle the events.(c) Have the object
Which is the super-class of all event classes?
Which of these packages contains all the classes and methods required for event handling in Java?(a) java.applet(b) java.awt(c) java.event(d) java.awt.eve
What method is used to specify a container’s layout?
What is an event in delegation event model used by Java programming language?(a) An event is an object that describes a state change in a source.(b) An event is an object that describes a state
What are the advantages of swing over AWT?
Which of these methods are used to register a keyboard event listener?(a) KeyListener()(b) addKistener()(c) addKeyListener()(d) eventKeyboardListener()
What interface is extended by AWT event listeners?
Which of these methods are used to register a mouse motion listener?(a) addMouse()(b) addMouseListener()(c) addMouseMotionListner()(d) eventMouseMotionListener()
What is the relationship between an event-listener interface and an event-adapter class?
Which of the following classes are derived from the Panel class.(a) Applet(b) Dialog(c) Frame(d) Button
What are events, event sources and event listeners?
What is a listener in context to event handling?(a) A listener is a variable that is notified when an event occurs.(b) A listener is an object that is notified when an event occurs.(c) A listener is
Which of these libraries contains top-most Event class?(a) java.awt.event(b) java.lang(c) java.awt(d) java.uti
Which of these methods can be used to determine the type of event?(a) getID()(b) getSource()(c) getEvent()(d) getEventObject()
Which of these classes is super-class of all the events?(a) EventObject(b) EventClass(c) ActionEvent(d) ItemEvent
Which of these events will be notified if scroll bar is manipulated?(a) ActionEvent(b) ComponentEvent(c) AdjustmentEvent(d) WindowEvent
What does the following line of code do? Textfield text = new Textfield(10);(a) Creates text object that can hold 10 rows of text.(b) Creates the object text and initializes it with the value
Which of the following methods can be used to change the size of a java.awt.Component object?(i) dimension()(ii) setSize()(iii) area()(iv) size()(v) resize()(a) (ii) & (v)(b) (i), (ii), (iii) &
The setBackground() method is part of the following class in java.awt package:(a) Graphics(b) Applet(c) Component(d) Container(e) Object
What is the full form of DOM?(a) Dynamic Object Model(b) Distributed Object Model(c) Document Object Model(d) Dense Object Model
How many parts are there in the W3C DOM specification?(a) 2(b) 3(c) 4(d) 5
How do you add a node at the beginning of a list of child nodes?
What is the number of parent nodes that a node in the DOM tree can have?(a) 1(b) 2(c) 3(d) 4
Discuss how all the attributes of an element node are obtained.
How do you add a node at the end of a list of child nodes?
How many Document nodes does a DOM tree have?(a) 1(b) 2(c) 3(d) 4
Describe how a DOM tree is saved in a file.
Which of the following is used to inspect the type of a node?(a) Type(b) TypeOfNode(c) NodeType(d) GetNodeType
Write a program to display the content of a DOM tree.
What is the value of the nodeName attribute for a Text node?(a) $text(b) text#(c) #text#(d) #text
What is the difference between shallow clone and deep clone?
What is the value of nodeType attribute for a Text node?(a) 1(b) 2(c) 3(d) 4
Describe the procedure for validating XML documents against a DTD.
Which of the following statements are incorrect?(a) Default constructor is called at the time of declaration of the object if a constructor has not been defined.(b) Constructor can be
When does an Object becomes eligible for Garbage collection in Java?
How can you force garbage collection of an object?(a) Garbage collection cannot be forced.(b) Call System.gc().(c) Call Runtime.gc().(d) Set all references to the object to new values(null, for
What is finalize method in Java? When does Garbage collector call finalize method in Java?
When is the Demo object eligible for garbage collection?(a) After line 5(b) After line 6(c) After the start() method completes(d) When the instance running this code is made eligible for garbage
Can we force Garbage collector to run at any time?
After line 8 runs, how many objects are eligible for garbage collection?(a) 0(b) 1(c) 2(d) 3 public class X { public static void main(String[] args) { X X = new X(); X x2 = m1 (x); /* Line 4 */
Does Garbage collection occur in permanent generation space in JVM?
Which of the following options is used to set initial heap size?(a) -Xmx(b) -Xss(c) -Xms(d) None of the above
How do you monitor garbage collection activities?
JVM options start with(a) -X(b) -XX(c) -JVM(d) Both a) and b)
Which part of the memory is involved in Garbage Collection? Stack or Heap?
If garbage collection occurs on young generation, it is called(a) Major collection(b) Minor collection(c) Small collection(d) Young collection
What is the responsiblity of Garbage Collector?
If garbage collection occurs on all generations, it is called(a) Major collection(b) Minor collection(c) Large collection(d) Young collection
What are the different ways to make an object eligible for Garbage Collection when it is no longer needed?
The portion of heap where short aged objects are kept is called(a) New generation(b) Young generation(c) Fresh generation(d) First generation
How can the Garbage Collection be requested?
The portion of heap where relatively long aged objects are kept is called(a) Old generation(b) Permanent generation(c) Previous generation(d) Second generation
What is the purpose of overriding finalize() method?
Showing 900 - 1000
of 1226
1
2
3
4
5
6
7
8
9
10
11
12
13