Advance Java Unit 4 MCQ
Advance Java Unit 4 MCQ
Unit 4
Explanation:D) 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.
a) 1
b) 7
c) 6
d) 4
Explanation: D) Total JDBC drivers available is 4.
9.Total TCP/IP ports reserved for specific protocols is …….
a) 1024
b) 2048
c) 512
d) 32
Explanation: A) Total TCP/IP ports reserved for specific protocol is 1024.
b) Connection
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
Explanation: B) The total number of ResultSet available with the JDBC 2.0 core API is 3.
17. Where can BLOB, CLOB, ARRAY, and REF type columns be updated?
a) JDBC 1.0
b) JDBC 2.0
c) JDBC 3.0
d) JDBC 4.0
Explanation: C) BLOB, CLOB, ARRAY, and REF type columns be updated in JDBC 3.0
c) Type 3 driver
d) Type 4 driver
c) ResultSet
d) Driver
b) Tomcat
c) Apache
d) WebLogic
21. Which of the following option leads to the portability and security of Java?
a) Dynamic binding between objects
b) Use of exception handling
23. Which of the following tags does the JSP page contain?
a) JSP tags
b) HTML tags
c) Both A and C
d) None of the above
Explanation: : C) JSP page contains both JSP tags and HTML tags.
24. Which of the following ways is used to communicate from an applet to servlet?
a) HTTP communication
b) Socket communication
c) RMI communication
d) All of the above
Explanation: D) All of the above is used to communicate from an applet to the servlet.
c) Declaration tag
d) 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.
a) True
b) False
27. Among the following, identify the packages which represent interfaces and classes for the
servlet API.
a) javax.servlet.http
b) javax.servlet
c) Both A and B
d) None of the above
28. Among the following methods, which of the following returns a proxy object?
a) getDatabase()
b) get()
c) load()
d) loadDatabase()
c) Slower performance
d) Using more memory
30. Among the following protocols are used for splitting and sending packets to an address
across a network:
a) SMTP
b) TCP/IP
c) UDP
d) FTP
Explanation: B) TCP/IP .is used for splitting and sending packets to an address across a network.
31. Among the following, which attribute is used to specify the class name of the bean:
a) id
b) class
c) name
d) constructor-args
b) java.io.time
c) java.io.timestamp
d) java.sql.time
33: What is the purpose of the finally block in a Java try-catch-finally construct?
a) To catch and handle exceptions thrown in the try block
b) To execute code regardless of whether an exception is thrown or not
34: Which of the following access modifiers provides the widest scope of visibility for a class
member in Java?
a) private
b) protected
c) default
d) public
Explanation: D) public
c) Both A and B
d) None of the above
c) Tag
d) Export
37: Among the following which method is used to know the host of an URL?
a) findhost()
b) gethost()
c) locatehost()
d) host()
c) Log
d) All of the above
b) 3
c) 4
d) 5
40: Choose whether true or false: The JDBC API is what allows access to a data source from a
Java middle tier.
a) True
b) False
41: Choose whether true or false: The ResultSet.next method is used to move to the next row of
the ResultSet, making the current row
a) True
b) False
42: Choose whether true or false: The web server is used for loading the init() method of the
servlet.
a) True
b) False
c) ViewResolver
d) View Facelets
b) Setup() method
c) Initialization
d) Constructor function
Explanation: A) Constructor can be used for a servlet by Initialization and a Constructor function.
46: Identify among the following which follows the connectionless service.
a) HTTP
b) TCP/IP
c) TCP
d) UDP
c) Both A and B
d) None of the above
Explanation:C) Both datagram packet and datagram socket is used for connection-less socket
programming
c) Both A and B
d) None of the above
49: Identify the method of the JDBC process among the following options.
a) remove()
b) deletebatch()
c) setbatch()
d) addbatch()
50: Identify the method which is used to find the URL from the cache of httpd.
a) getfromcache()
b) findfromcache()
c) findcache()
d) servefromcache()
Explanation: D) servefromcache() is used to find the URL from the cache of httpd.