Sun Java Solaris Communities My SDN Account Join SDN
 
Quizzes

Advanced Programming for the Java 2 Platform Quiz - Part 1

 

Quizzes Index

2 Platform Quiz
Part One

November 2000

Advanced Programming Test your knowledge of distributed computing, accessing a database, using servlets, and more from the book Advanced Programming for the Java 2 Platform.
1. A session bean does not survive server crashes.
 A. True
 B. False


2. What happens during data marshaling?
 A. The remote server object is created and its data echoed back to the client.
 B. RMI APIs are called on the thin client, the data is serialized, and sent to the remote server object.
 C. Methods that are called on a remote server object are wrapped with their data and sent to the remote server object, where they are unwrapped and executed.
 D. Data is serialized and stored in the database, where it can be reached by the remote server for processing the object as needed.


3. If you want a bean to manage its own transactions, you have to configure the Enterprise JavaBeans server with which kind of settings?
 A. JDBC service type, isolation level, commit mode
 B. Transaction attribute, commit mode, isolation level
 C. Transaction type, commit mode, RMI service type
 D. Isolation level, transaction attribute, transaction type


4. When would you use an Interoperable Object Reference (IOR)?
 A. As a backup protocol for data marshaling.
 B. When a naming service is not compatible among all Object Request Brokers (ORBs).
 C. To bind the remote server object to an ORB.
 D. When a naming service is not compatible across remote method invocations.


5. What is the RMI-IIOP API used for?
 A. To look up an object written in something other than the Java programming language.
 B. To create a two-stage lookup.
 C. To plug lookup services from various providers into a program written in the Java programming language.
 D. To transmit Interoperable Object References (IORs) between RMI clients.


6. How does RMI prevent potential memory leaks from client references to remote objects when the clients have aborted or the network connection has dropped?
 A. The remote server object sets an expiration time on all exported objects, and when the time reaches -1, theJava virtual machine1 sets the remote object for garbage collection if it cannot locate the client.
 B. The virtual machine sets an expiration time on all exported object, and when the time reaches -1, the remote object is set for garbage collection.
 C. The remote server object's container continually checks for references, and when a remote object has no more references, it is set for garbage collection.
 D. The Java virtual machine sets an expiration time on all exported objects, and when the time reaches 0, the remote object is set for garbage collection.


7. What kind of exception is raised if you try to map a java.lang.String to a fixed size or bounded IDL string?
 A. MARSHAL exception
 B. DATA_CONVERSION exception
 C. RMI exception
 D. CORBA exception


8. CORBA does not have a distributed garbage collection mechanism.
 A. True
 B. False


9. When you use the Java Native Interface (JNI) to retrieve a reference to an array residing in your program, what does the Java virtual machine do to prevent the array from being moved by the garbage collector when it compacts heap memory?
 A. Marshals the reference.
 B. Serializes and stores the array data.
 C. Pins the array into memory.
 D. Uses a weak reference to deny the garbage collector access to the array.


10. In JNI, how do you make an object persist across native method calls?
 A. By calling NewInstanceVariable on the local reference.
 B. By calling NewGlobalPersist on the local reference.
 C. By calling NewInstanceGlobal on the local reference.
 D. By calling NewGlobalReference on the local reference.

_______
1 As used on this web site, the terms "Java virtual machine" or "JVM" mean a virtual machine for the Java platform.