Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Advance Java Unit 4 MCQ

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 7

Advance Java

Unit 4

1. What is the RMI server responsible for?


a) Exporting remote object
b) Creating an instance of the remote object

c) Binding an instance of the remote object to the RMI registry


d) All of the above (Correct)

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.

2. Identify the Microsoft solution for providing dynamic web content:


a) ASP (Correct)
b) JSP
c) Both A and B
d) None of the above
Explanation: ASP (Active Server Pages) is Microsoft's solution for creating dynamic web pages.

3. In which file is database table configuration stored?


a) .sql
b) .ora
c) .hbm (Correct)
d) .dbm
Explanation: : ) Database table configuration file is stored in .hbm

4. RMI stands for:


a) Remote Memory Interface
b) Remote Method Invocation (Correct)
c) Random Method Invocation
d) None of the above
Explanation: : RMI stands for Remote Method Invocation.
5. TCP, FTP, SMTP, Telnet are examples of:
a) IP address
b) Protocol (Correct)
c) Socket
d) MAC address

6. The total JDBC product components in Java software are 4.


a) JDBC API
b) JDBC Driver Manager
c) JDBC Test Suite
d) JDBC-ODBC Bridge
7. The total number of techniques used in session tracking is 4.
a) Cookies
b) URL Rewriting
c) Hidden Form Fields
d) HttpSession
8. Total JDBC drivers available are 4.
These are:
a) JDBC-ODBC Bridge Driver
b) Native-API Driver (Partially Java Driver)
c) Network Protocol Driver (Fully Java Driver)
d) Thin Driver (Pure Java Driver)
So, the correct option is 4.
9. Total TCP/IP ports reserved for specific protocols are 1024.
The first 1024 ports (0-1023) are reserved for well-known services such as HTTP, FTP, and DNS.
So, the correct option is 1024.
10. The major components of JDBC are:
a) DriverManager
b) Connection

c) Statement
d) ResultSet

11. What decides the priority of the thread?


Thread
Process scheduler
Process
Thread scheduler

12. What is built on top of socket programming?


a) RMI
b) EJB
c) Both A and B
d) None of the above
13. What is the difference between servlet and JSP?
 a) Compilation
 b) Translation
 c) Syntax
 d) Both A and B

14. Identify the method which is used to start a server thread.


 a) start thread()
 b) run()
 c) runthread()
 d) start()

15. What is the total number of bits in a single IP address?


 a) 4
 b) 8
 c) 16
 d) 32

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

18. Which driver is known as the thin driver in JDBC?


 Type 1 driver
 Type 2 driver
 Type 3 driver
 Type 4 driver

19. Which is responsible for getting a connection to the database?


 Connection
 Statement
 ResultSet
 Driver

20. Which of the following are examples of application servers?


 JBoss
 Tomcat
 Apache
 WebLogic
21. Which of the following option leads to the portability and security of Java?
 Dynamic binding between objects
 Use of exception handling
 Bytecode is executed by JVM
 The applet makes the Java code secure and portable

22. Which of the following requires fewer resources?


 Process
 Thread
 Both Thread and Process
 Neither thread nor process

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

You might also like