1. Suppose the tester class has the following test method:
public int test (int p1, Integer p2)
Which of the following code can correctly dynamically invoke the test method of a Tester object. (radio)
A
Class Classtype=tester.class;
Object tester=classtype.newinstance ();
Method Addmethod=classtype.getmethod ("Test", New Class[]{int.class,int.class});
Object Result=addmethod.invoke (Tester,
New Object[]{new Integer (m), new Integer (200)});
B
Class Classtype=tester.class;
Object tester=classtype.newinstance ();
Method Addmethod=classtype.getmethod ("Test", New Class[]{int.class,int.class});
int Result=addmethod.invoke (tester,
New Object[]{new Integer (m), new Integer (200)});
C
Class Classtype=tester.class;
Object tester=classtype.newinstance ();
Method Addmethod=classtype.getmethod ("Test", New Class[]{int.class,integer.class});
Object Result=addmethod.invoke (Tester,
New Object[]{new Integer (m), new Integer (200)});
D
Class Classtype=tester.class;
Object tester=classtype.newinstance ();
Method Addmethod=classtype.getmethod ("Test", New Class[]{int.class,integer.class});
Integer Result=addmethod.invoke (Tester,
New Object[]{new Integer (m), new Integer (200)});
2. Which of the following methods is defined in the class class. (Multiple selection)
A GetConstructors () B. Getprivatemethods () C. Getdeclaredfields ()
D Getimports () E. SetField ()
3. Which of the following statements is true? (Multiple selection)
A Dynamic proxy classes, like static proxy classes, must be written by developers and compiled
into a. class file
B The proxy class has the same interface as the proxy class
C The Java.lang.Exception class implements the Java.io.Serializable interface, so the exception object
Can be serialized and transmitted over the network
D The proxy class in the Java.lang.reflect package provides a way to create a dynamic proxy class
4. Which of the following is characteristic of the dynamic proxy class. (Multiple selection)
A Dynamic proxy classes are public, final, and non-abstract types.
B The dynamic proxy class inherits the Java.lang.reflect.Proxy class
C The dynamic proxy class implements the parameters in the Getproxyclass () or Newproxyinstance () method
Interfaces all interfaces specified by
D Dynamic proxy classes can inherit any user-defined classes
E. Dynamic proxy classes have a constructed method of the public type, which has a
Parameters for Invocationhandler type
5. In the example described in Section 10.3.3 of this chapter (using the proxy class in the remote Method invocation), Connector
Class is on the server side or the client. (radio)
A Server-side B. Client
6. In the example described in Section 10.3.3 of this chapter (using proxy classes in remote method calls),
The Helloserviceproxy class is located on the server side or the client. (radio)
A Server-side B. Client
Answer: 1. C 2. AC 3. BCD 4. ABCE 5. B 6. B