11/4/25, 10:46 PM Blank Quiz High-Level MCQs on Java Programming (Modules IV, V, VI)
Blank Quiz High-Level MCQs on Java
Programming (Modules IV, V, VI)
Total points 0/0
Assignment 2
Subject: OOP
Class: SE A
0 of 0 points
Name: *
Kakad Atharva Satish
Roll No: *
54
Questions: 0 of 0 points
1 Which of the following best defines an exception in Java? *
A) A syntax error detected during compilation
B) An event that disrupts the normal flow of program execution
C) A type of thread used for error handling
D) A method that handles runtime logic
[Link] 1/10
11/4/25, 10:46 PM Blank Quiz High-Level MCQs on Java Programming (Modules IV, V, VI)
2. Which keyword in Java is used to handle exceptions? *
A) catch
B) handle
C) try
D) Both A and C
3. What is the superclass of all exceptions in Java? *
A) Throwable
B) Exception
C) Error
D) Object
[Link] of the following exceptions are checked exceptions?
A) IOException
B) Null Pointer Exception
C) Arithmetic Exception
D) Array Index Out Of Bounds Exception
[Link] 2/10
11/4/25, 10:46 PM Blank Quiz High-Level MCQs on Java Programming (Modules IV, V, VI)
5. What will happen if an exception is not caught in Java? *
A) The program will continue normally
• B) The JVM will terminate the program
C) The exception will be ignored
D) The compiler will fix it automatically
6. Which block must always be followed by either a catch or finally block? *
A) try
B) throw
C) catch
Option 4
7. How can custom exceptions be created in Java? *
A) By extending the Exception class
• B) By using the throw keyword only
C) By implementing Runnable
D) By extending the Object class
[Link] 3/10
11/4/25, 10:46 PM Blank Quiz High-Level MCQs on Java Programming (Modules IV, V, VI)
8. What is the purpose of the finally block in Java exception handling?
A) To rethrow exceptions
B) To execute code after try/catch regardless of outcome
C) To handle multiple exceptions
D) To skip execution when exceptions occur
10. What is the lifecycle method used to start a thread? *
A) run()
B) start()
C) execute()
D) init()
9. Which of the following is NOT a valid way to create a thread in Java? *
A) Extending Thread class
• B) Implementing Runnable interface
• C) Calling run() directly
• D) Using the start() method
[Link] 4/10
11/4/25, 10:46 PM Blank Quiz High-Level MCQs on Java Programming (Modules IV, V, VI)
11. Which keyword is used to ensure that a method can be accessed by only one *
thread at a time?
A) locked
B) static
C) synchronized
D) threadsafe
12. What is a daemon thread in Java? *
• A) A thread that runs continuously in the background
• B) A thread that handles exceptions
• C) A thread created by the JVM only
• D) A thread that executes GUI operations
13. What is a deadlock in multithreading? *
A) When threads execute continuously without stopping
B) When two or more threads wait for each other’s resources indefinitely
C) When a thread completes its execution
D) When a thread is paused temporarily
Option 5
[Link] 5/10
11/4/25, 10:46 PM Blank Quiz High-Level MCQs on Java Programming (Modules IV, V, VI)
14. Which method puts a thread to sleep for a specified time? *
A) sleep()
B) wait()
C) pause()
D) suspend()
15. Which interface must be implemented for a class to become a thread? *
A) Runnable
B) Threadable
C) Executor
D) Callable
16. What happens when the start() method is called twice on the same thread *
object?
A) The thread restarts execution
B) The thread executes normally
C) An IllegalThreadStateException is thrown
D) It creates a new thread
[Link] 6/10
11/4/25, 10:46 PM Blank Quiz High-Level MCQs on Java Programming (Modules IV, V, VI)
17. What package is primarily used for GUI programming in Java? *
A) [Link]
B) [Link]
C) [Link]
D) [Link]
18. Which class is the top-level container for Swing components? *
A) JPanel
B) JFrame
C) JButton
D) JContainer
19. Which method is used to make a Swing frame visible? *
A) set Visible (true)
B) show()
C) display()
D) run()
[Link] 7/10
11/4/25, 10:46 PM Blank Quiz High-Level MCQs on Java Programming (Modules IV, V, VI)
20. What is the role of JDBC in Java? *
A) Provides GUI design tools
B) Allows database connectivity and data manipulation
C) Handles exceptions in SQL
D) Creates threads for SQL queries
21. Which JDBC interface is used to execute SQL queries? *
A) Connection
B) Statement
C) ResultSet
D) Prepared Statement
22. What is the purpose of the ResultSet interface in JDBC? *
A) To hold data returned by a query
B) To execute SQL commands
C) To store SQL connection details
D) To manage multiple database connections
[Link] 8/10
11/4/25, 10:46 PM Blank Quiz High-Level MCQs on Java Programming (Modules IV, V, VI)
23. Which Swing component is used to create a button? *
A) JLabel
B) JButton
C) JTextField
D) JList
24. Which JDBC class is used to handle SQL exceptions? *
• A) SQLException
• B) IOException
• C) RuntimeException
• D) SQLHandler
This form was created inside of SLRTCE. - Contact form owner
Does this form look suspicious? Report
Forms
[Link] 9/10