Sunteți pe pagina 1din 5

Question Paper - Java Part 2

Session 26-28 - Swing


1- A _________ is a component that appears as a group of folders in a file cabinet
a) Tabbed pane
b) Tree
c) Tables
2- Which swing package contains the pluggable look and feel API ?
a) javax.swing.plaf
b) javax.swing.olug
c) javax.swing.basic
d) javax.swing.tree
3- Which of the following are valid methods of the Abstract Button class? (choose 3)
a) void setDisabledIcon()
b) void setPressedIcon()
c) void setSelectedIcon()
d) void SelectionItem()
4- Which of the following are valid declarations of constructor for JTextField class?
(Choose three)
a) JTextField()
b) JTextField(String s)
c) JTextField(String s, int cols)
d) JTextField(String s, int rows)
5- A______________ is an interface that specifies how a tree is mapped over a data
structure .
a) TreeModel
b) Tree
c) Tables
6- Which 2 of the following are valid methods of the Icon interface in Swing
package?
a) int getIconHeight()
b) int getIconWidth()
c) int getIconLength()
d) int getIconBreadth()

Session 30-32 - JDBC


1- The ________ uses local native libraries to communicate with the database
a. JDBC-ODBC Bridge
b. Native-API-Partly-Java Driver
c. JDBC-Net-All-Java-Driver
d. Native-Protocol-All-Java-Driver
2- The Java software provides three JDBC product components, they are
a) the JDBC DriverManager facility
b) the JDBC driver test suite
c) the JDBC-ODBC bridge
d) the callable statement
3- A __________ result set has a cursor that moves both forward and backward and
can be moved to a particular row
a) scrollable
b) nonscrollable
c) Unscrollable
4- Which interface of the JDBC API provides methods to retrieve data that an SQL
statement returns?
a) ResultSet
b) Statement
c) Driver
d) Connection
5- The method___________ is designed for statements that produce a single result
set, such as SELECT statement
a) executeUpdate
b) execute
c) Update
d) executeQuery

Session 34 – Networking
1) Which constructor of the ServerSocket class creates a server socket an the
specified port with a queue length of 50?
a) ServerSocket(int port)
b) ServerSocket(int port,int maxQueue)
c) ServerSocket(int port,int MaxQueue,InetAddress localAddress)
2) Which of the following is a general purpose class for accessing the attributes of
resource?
a) URL Connection
b) URL Encoder
c) URL
3) The _____, and_______, and_______ classes are for use with UDP (choose 3)
a) DatagramPacket
b) DatagramSocket
c) MulticastSocket
d) ServerSocket
4) _________ is a low – level routing protocol that breaks data into small packets
and sends them to an address across a network, which does not guarantee to deliver
packets to the destination.
a) Internet Protocol
b) Transport Control Protocol
c) User Datagram Protocol
5) Which method of the Socket class returns the remote port to which the Socket
objects connected?
a) int getPort()
b) int getLocalPort()
c) InetAddress getInetAddress()
6) The _____ , ______ , _______ ,and ________ classes all use TCP to communicate
over the network . (Choose 4)
a) URL
b) URLConnection
c) Socket
d) ServerSocket
e) DatagramSocket
7) A ________ is one end – point of a two–way communication link between two
programs running on the network.
a) Socket
b) ServerSocket
c) Connection

Session 36 – RMI
1) Which three of the following are classes of Java.rmi package?
a) Naming
b) MarshalledObject
c) RMISecurityManager
d) Remote
2) The bind() and rebind() method belongs to which class of the java.rmi package.
a) Naming class
b) RMISecurityManager class
c) RMIloader class
3) What will marshall and unmarshall your object? (choose 2)
a) Sub
b) Skeleton
c) Client
d) Server
4) Which of the following statements are true with reference to RMI ?
i. RMI is language independent.
ii. RMI is platform independent.
a) Only Statement 1 is true.
b) Only Statement 2 is true.
c) Both the statements are true.
d) Both the statements are false.
5) _______ classs is a sub-class of RemoteObject in Java RMI.
a) RemoteServer
b) Operation
c) LogStream
d) MarshalledObject
6) Which of the following Exceptions are thrown for protocol errors or
communication failure?
a) RemoteException
b) ConnectException
c) AccessException
d) UnExceptedException
7) _________ is thrown if we attempt to invoke a method on a remote object that
does not exist .
a) NoSuchMethodException
b) NoSuchServerException
c) NoSuchObjectException
d) InvalidRefrenceException

Session 38 - Java Beans


1) Which interface methods allow a bean to execute in environments where a
graphical user interface is not available?
a) PropertyEditor
b) Visivility
c) BeanInfo
d) Beans
2) Which class of java beans package analyses a bean and contructs a BeanInfo
object that describes the component?
a) Introspector
b) Beans
c) BeanInfo
3) _________ is used to obtain information about the fields, constructors of any class
a) Introspection
b) Persistence
c) Reflection
d) Event
e) Attribute
4) The _______ interface of the java.beans package allows a designer to provide a
graphical user interface through which a bean may be configured
a) Customizer
b) Visibility
c) DesignMode
d) BeanInfo
5) Which interface of the java.beans package allows a designer to specify
information about the properties, events and methods of a Bean?
a) BeanInfo
b) Visibility
c) Customizer
6) _____ object describes State changes in the source.
a) Event
b) Listener
c) EventHandler
d) None of the others

Session 39 - Java Security


1) Which option of jar file indicates manifest file not created?
a) Jar M
b) Jar t
c) Jar m
d) Jar c
2) _______ option of Jar command makes a Java archive file.
a) JAR -c
b) JAR -m
c) JAR -v
d) JAR –f
3) Which command adds the file file.class to Xyz.jar?
a) jar – uf Xyz . jar file.class
b) jar – xf Xyz . jar
c) jar – tf Xyz . jar

Addition
1/ The ______ consists of names across all cells within an enterprise
a) Directory services
b) Security services
c) Remote services
2/ The _______ method of the ActivationDesc class returns the object containing
serialized information
a) getData()
b) getGroupData()
c) getRestartModel()
3/ Which of the following classes in java.lang.reflect package contains integer
constants and static methods?
a) Constructors
b) Modifiers
c) Members
d) Arrays

S-ar putea să vă placă și