The following quiz “Advance Java MCQ Questions and Answers” provides Multiple Choice Questions (MCQs) related to Advanced Java Programming. These Advanced Java Programming MCQs are also Interviews (campus interview, walk-in interview, company interview), Placement or recruitment, entrance examinations, and competitive examinations oriented. You can practice the below questions to improve your Advanced Java skills. You can click on the View Answer button to check the answer if you needed. Let’s solve this Advance Java MCQ Questions and Answers Quiz. So, Advance Java is also a part of the Java programming language which is generally used for web-based applications and enterprise applications.
You can practice these Advance Java MCQs here and if you want a pdf of Advance Java MCQ Questions And Answers, we will provide a downloading link here soon so please keep visiting here for further modifications. For core java MCQs, visit here.
01. Which of the following is not a kind of exception that is thrown by the JDBC method?
- SQL Exception
- SQL Warning
Answer : A Explanation: None
02. Which of the following option leads to the portability and security of Java?
- The applet makes the Java code secure and portable
- Bytecode is executed by JVM
- Use of exception handling
- Dynamic binding between objects
Answer : B Explanation: As we all know, the output of the Java compiler is bytecode, which leads to the security and portability of the Java code. Bytecode is a highly developed set of instructions that are designed to be executed by the Java runtime system known as Java Virtual Machine (JVM). The Java programs executed by the JVM make the code portable and secure. Because JVM prevents the code from generating its side effects. The Java code is portable, as the same byte code can run on any other platform.
03. When the ejbRemove method encounters a system problem,it should throw_______
Answer : C Explanation: java.ejb.EJBException
04. What are the major components of the JDBC?
- DriverManager, Statement, and ResultSet
- DriverManager, Connection, Statement, and ResultSet
- DriverManager, Driver, Connection, and Statement
- DriverManager, Driver, Connection, Statement, and ResultSet
Answer : D Explanation: DriverManager, Driver, Connection, Statement, and ResultSet
05. Which of the following is correct about the Statement class of JDBC?
- Statement encapsulates an SQL statement which is passed to the database to be planned and executed
- Statement encapsulates an SQL statement which is passed to the database to be parsed and compiled
- Both of the mentioned
- None of the mentioned
Answer : C Explanation: Both of the mentioned
06. Which of the following is advantage of using JDBC connection pool?
- Better performance
- Slow performance
- Using more memory
- Using less memory
Answer : A Explanation: Since the JDBC connection takes time to establish. Creating connection at the application start-up and reusing at the time of requirement, helps the performance of the application. Hence, Option A is correct.
07. The method on the result set that tests whether or not there remains at least one unfetched tuple in the result set, is said to be
- Fetch method
- Next method
- Current method
- Access method
Answer : B Explanation: Next method
08. To run a compiled java program the machine must have the following loaded and running
- Java virtual machine
- Java compiler
- Java bytecode
- A Web browser
Answer : A Explanation: JVM
09. Which is responsible for getting a connection to the database?
Answer : B Explanation: The Driver interface is responsible for getting a connection to the database and the Connection interface is responsible for communication with the database but not making the initial connection. The Statement interface knows how to run the SQL query, and the ResultSet interface knows what was returned by a SELECT query and hence option B is correct.
10. Thin driver is also known as?
- Type 3 Driver
- Type-2 Driver
- Type-4 Driver
- Type-1 Driver
Answer : C Explanation: The JDBC thin driver is a pure Java driver and it is also known as Type-4 Driver.