Top 250+ Solved Java Programming MCQ Questions Answer
Q. The ActionListener interface is used for handling action events,For example,it's used by a
a. JButton
b. JCheckbox
c. JMenuItem
d. All of these
Q. Which is the container that doesn't contain title bar and MenuBars. It can have othercomponents like button, textfield etc?
a. Window
b. Frame
c. Panel
d. Container
Q. Which of these package is used for all the text related modifications?
a. javtext
b. java.awt
c. java.lang.text
d. java.text.mofify
Q. RMI has which of these protocols implementations?
a. Java Remote Method Protocol (JRMP)
b. Internet Inter-ORB Protocol (IIOP)
c. Jinni Extensible Remote Invocation (JERI)
d. All mentioned above
Q. In RMI which layer defines and supports the invocation semantics of the RMIconnection, this layer maintains the session during the method call?
a. The Stub & Skeleton Layer
b. The Application Layer
c. The Remote Reference Layer
d. The Transport Layer
Q. Which method of the Naming class (found in java.rmi) is used to update the RMIregistry on the server machine?
a. rebind ()
b. lookup()
c. Both A & B
d. None of the above
Q. In RMI program the following two steps are used to, Either extend the UnicastRemoteObject class, the exportObject() method of the UnicastRemoteObject class,
a. Provide the Implementation of the remote interface
b. Create the remote interface
c. Create and start the remote application
d. Compile the implementation class and create the stub and skeleton objects using the rmic tool
Q. Which is built on the top of socket programming?
a. EJB
b. RMI
c. Both A & B
d. None of the above
Q. In RMI program the following example shows the,import java.rmi.*; public interface Adder extends Remote{ public int add(int x,int y)throws RemoteException; }
a. Create and start the remote application
b. Create and start the client application
c. Create the remote interface
d. Provide the implementation of the remote interface
Q. In RMI applications which program obtains a remote reference to one or more remote objects on a server and then invokes methods on them?
a. Server
b. Client
c. Both A & B
d. None of the above
Q. Which is a one-way communication only between the client and the server and it is not a reliable and there is no confirmation regarding reaching the message to the destination?
a. TCP/IP
b. UDP
c. Both A & B
d. None of the above
Q. In a RMI Client Program, what are the exceptions which might have to handled?
a. RemoteException
b. NotBoundException
c. MalFormedURLException
d. All mentioned above
Q. Abbreviate the term DGC?
a. Digital Garbage Collection
b. Distributed Garbage Collection
c. Distributed Garbage Connection
d. None of the above
Q. Which of the following is a type of polymorphism in Java?
a. Compile time polymorphism
b. Execution time polymorphism
c. Multiple polymorphism
d. Multilevel polymorphism
Q. When does method overloading is determined?
a. At run time
b. At compile time
c. At coding time
d. At execution time