MCQ Bank Java Programming
MCQ Bank Java Programming
A) Procedural
B) Functional
C) Object-oriented
D) Logical
181. Which class in Java is used for reading text from a character-input stream?
A) FileReader B) BufferedReader C) InputStreamReader D) FileWriter
182. What is the purpose of the java.io.BufferedWriter class?
A) For reading text from a character-input stream B) For writing text to a character-output
stream C) For reading binary data from a file D) For writing binary data to a file
183. Which of the following is NOT a predefined stream in Java?
A) Standard.in B) Standard.out C) Standard.err D) Standard.log
184. Which package in Java provides classes and interfaces for handling networking
operations?
A) java.net B) java.io C) java.lang D) java.util
185. What is the primary purpose of the Delegation Event Model in Java?
A) To handle events through delegation B) To model delegation in object-oriented programming
C) To manage event listeners efficiently D) To facilitate communication between objects
186. Which of the following represents an event class in Java?
A) ActionListener B) AbstractWindowAdapter C) EventHandler D) EventManager
187. Which interface should a class implement to handle action events in Java?
A) ActionListener B) EventHandler C) EventListener D) ActionListenerInterface
188. Which Java concept is used to provide default implementations for listeners?
A) Delegation B) Inheritance C) Adapter classes D) Abstract classes
189. Which of the following is NOT an inner class type in Java?
A) Static inner class B) Non-static inner class C) Local inner class D) Global inner class
190. What is the primary purpose of AWT controls in Java?
A) To manage data flow in a program B) To provide a graphical user interface C) To handle
networking tasks D) To implement sorting algorithms
191. Which layout manager is suitable for creating resizable components in Java?
A) BorderLayout B) FlowLayout C) GridLayout D) CardLayout
192. Which Java class is used to represent images?
A) Image B) ImageIcon C) ImageLoader D) ImageProcessor
193. Which of the following is used to handle animation in Java?
A) Thread B) Timer C) ExecutorService D) Semaphore
194. What is the purpose of Java Applets?
A) To create standalone desktop applications B) To provide dynamic content on web pages C) To
handle database operations D) To manage server-side scripting
195. What is the primary role of the Spring Framework in Java development?
A) To provide a standardized way to build enterprise applications B) To handle graphical user
interface components C) To manage database connections D) To create mobile applications
196. Which architectural pattern is commonly associated with the Spring Framework?
A) Model-View-Controller (MVC) B) Observer C) Singleton D) Prototype
197. What is the primary role of the Bean Factory in Spring Framework?
A) To manage beans and their dependencies B) To handle user authentication C) To provide
encryption services D) To execute batch processing tasks
198. Which package in Java provides classes and interfaces for handling exceptions?
A) java.net B) java.lang C) java.util D) java.exception