Remote Method Invocation (RMI) MCQ SET-3

Errorlogger
0
1. What is Remote method invocation (RMI)?
a) RMI allows us to invoke a method of java object that executes on another machine.
b) RMI allows us to invoke a method of java object that executes on another Thread in multithreaded programming.
c) RMI allows us to invoke a method of java object that executes parallely in same machine.
d) None of the mentioned


2. Which of these package is used for remote method invocation?
a) java.applet
b) java.rmi
c) java.lang.rmi
d) java.lang.reflect


3. Which of these methods are member of Remote class?
a) checkIP()
b) addLocation()
c) AddServer()
d) None of the mentioned


4. Which of these Exceptions is thrown by remote method?
a) RemoteException
b) InputOutputException
c) RemoteAccessException
d) RemoteInputOutputException


5. Which of these class is used for creating a client for a server-client operations?
a) serverClientjava
b) Client.java
c) AddClient.java
d) ServerClient.java



6. Which of these package is used for all the text related modifications?
a) java.text
b) java.awt
c) java.lang.text
d) java.text.mofify



7. What is the output of this program?

  1.     import java.lang.reflect.*;
  2.     class Additional_packages {  
  3.          public static void main(String args[]) {
  4.       try {
  5.           Class c = Class.forName("java.awt.Dimension");
  6.    Constructor constructors[] = c.getConstructors();
  7.    for (int i = 0; i < constructors.length; i++)
  8.        System.out.println(constructors[i]);
  9.    }
  10.       catch (Exception e){
  11.              System.out.print("Exception");
  12.              }
  13.         }
  14.     }
a) Program prints all the constructors of ‘java.awt.Dimension’ package.
b) Program prints all the possible constructors of class ‘Class’.
c) Program prints “Exception”
d) Runtime Error


8. What is the output of this program?
  1.     import java.lang.reflect.*;
  2.     class Additional_packages {  
  3.          public static void main(String args[]) {
  4.       try {
  5.           Class c = Class.forName("java.awt.Dimension");
  6.    Field fields[] = c.getFields();
  7.    for (int i = 0; i < fields.length; i++)
  8.        System.out.println(fields[i]);
  9.    }
  10.       catch (Exception e){
  11.              System.out.print("Exception");
  12.              }
  13.         }    
  14.     }
a) Program prints all the constructors of ‘java.awt.Dimension’ package.
b) Program prints all the methods of ‘java.awt.Dimension’ package.
c) Program prints all the data members of ‘java.awt.Dimension’ package.
d) program prints all the methods and data member of ‘java.awt.Dimension’ package.


9. What is the length of the application box made by this program?
  1.     import java.awt.*;
  2.     import java.applet.*;
  3.     public class myapplet extends Applet {
  4.         Graphic g;
  5.         g.drawString("A Simple Applet",20,20);    
  6.     }
a) 20
b) Default value
c) Compilation Error
d) Runtime Error


10. What is the output of this program?
  1.     import java.lang.reflect.*;
  2.     class Additional_packages {  
  3.          public static void main(String args[]) {
  4.       try {
  5.           Class c = Class.forName("java.awt.Dimension");
  6.    Method methods[] = c.getMethods();
  7.    for (int i = 0; i < methods.length; i++)
  8.        System.out.println(methods[i]);
  9.    }
  10.       catch (Exception e){
  11.              System.out.print("Exception");
  12.              }
  13.         }
  14.     }
a) Program prints all the constructors of ‘java.awt.Dimension’ package.
b) Program prints all the methods of ‘java.awt.Dimension’ package.
c) Program prints all the data members of ‘java.awt.Dimension’ package.
d) program prints all the methods and data member of ‘java.awt.Dimension’ package.

Tags

Post a Comment

0Comments

Post a Comment (0)

#buttons=(Accept !) #days=(30)

Our website uses cookies to enhance your experience. Check Now
Accept !