Advance Java Unit 4 MCQ
Advance Java Unit 4 MCQ
Advance Java Unit 4 MCQ
Unit 4
Explanation: The RMI server is responsible for all these tasks—exporting the remote object, creating
instances of it, and binding it to the RMI registry to make it available for clients to call methods
remotely.
c) Statement
d) ResultSet
16. What is the total number of ResultSet available with the JDBC 2.0 core API?
a) 2
b) 3
c) 4
d) 5
17. Where can BLOB, CLOB, ARRAY, and REF type columns be updated?
JDBC 1.0
JDBC 2.0
JDBC 3.0
JDBC 4.0
23. Which of the following tags does the JSP page contain?
JSP tags
HTML tags
Both A and C
None of the above
24. Which of the following ways is used to communicate from an applet to servlet?
HTTP communication
Socket communication
RMI communication
All of the above
25. Which tag is used to execute Java source code in JSP?
Expression tag
Scriptlet tag
Declaration tag
None of the above
26. Choose whether true or false: JDBC is a Java API that is used to connect and execute
queries to the database.
True
False
27. Among the following, identify the packages which represent interfaces and classes for the
servlet API.
javax.servlet.http
javax.servlet
Both A and B
None of the above
28. Among the following methods, which of the following returns a proxy object?
getDatabase()
get()
load()
loadDatabase()
29. Among the following options, choose the one which shows the advantage of using the JDBC
connection pool:
Using less memory
Better performance
Slower performance
Using more memory
Correct Answer: Using less memory
30. Among the following protocols are used for splitting and sending packets to an address
across a network:
SMTP
TCP/IP
UDP
FTP
Correct Answers: TCP/IP and UDP
31. Among the following, which attribute is used to specify the class name of the bean:
id
class
name
constructor-args
Question 32: Among the following which contains date information?
java.sql.timestamp
java.io.time
java.io.timestamp
java.sql.time
Question 33: What is the purpose of the finally block in a Java try-catch-finally construct?
To catch and handle exceptions thrown in the try block
To execute code regardless of whether an exception is thrown or not
To define the conditions for handling exceptions
To provide an alternate code path when an exception occurs
Question 34: Which of the following access modifiers provides the widest scope of visibility for a
class member in Java?
private
protected
default
public
Question 35: Among the following which is a type of multitasking?
Thread based
Process-based
Both A and B
None of the above