stud
bud
Sign up
Log in
Home
Library
Explore
SAT
More
3rd Long Quiz Flashcards | StudBud
Explore
/
3rd Long Quiz
3rd Long Quiz
50 terms
·
StudBud Administration
Imported from external platform
Flashcards
50 cards
F
Practice quiz
P
Host live
L
Questions
50
Answers
1
What does an event listener do in a GUI-based application?
Manages the database
Compiles code
Detects syntax errors
Listens for user input such as clicks or key presses
2
Which of the following represents Multi-level Inheritance correctly?
Child → Parent → Grandparent
Parent → Child1 → Child2
Parent → Child
Parent → Child1, Parent → Child2
3
What happens when an exception is thrown in Java?
The compiler moves to the default catch block
The program auto-restarts
An error message is logged, but nothing else
The program continues as usual
4
What does the DELETE statement do in a database?
Removes data from a table
Clears the database schema
Renames a table
Hides data
5
What must be done when a class inherits from an abstract class?
It must delete all non-abstract methods
It must instantiate the abstract class
It must override all constructors
It must implement all abstract methods
6
What is the role of the “View” in the MVC architecture?
Processes business rules
Displays the user interface
Handles user input logic
Stores the data
7
Which CRUD operation would most likely be associated with the SQL DROP statement?
Update
Create
Read
Delete
8
What do you need to do to create a custom unchecked exception?
Implement the Throwable interface
Override the Error class
Extend the Exception class
Extend the RuntimeException class
9
What best describes Single Inheritance?
One parent and one child
One parent and multiple children
Multiple parents and one child
One class inheriting from multiple classes
10
In Java, which library is commonly used for building GUIs?
java.util
java.io
java.sql
java.awt / javax.swing
11
In Single Inheritance, how many classes are involved in total?
Three
More than three
One
Two
12
Which of the following statements is used to update existing records in SQL?
CREATE
INSERT
UPDATE
ALTER
13
What is the main purpose of exception handling in Java?
To preserve the normal flow of the program
To reduce the need for compilation
To improve memory management
To increase code performance
14
What keyword is used to throw an exception manually in Java?
catch
throw
catchs
throws
15
Which of the following is an example of a checked exception?
FileNotFoundException
ArithmeticException
ArrayIndexOutOfBoundsException
NullPointerException
16
In an OOP-based application, how is the relationship between GUI and database commonly handled?
The GUI interacts with the controller which in turn accesses the database
The database modifies GUI layouts directly
The GUI handles all database logic
The GUI compiles SQL code directly
17
What type of inheritance allows a class to inherit from more than one parent class?
Single Inheritance
Hierarchical Inheritance
Multiple Inheritance
Multi-level Inheritance
18
In Hierarchical Inheritance, how many superclasses are there?
None
More than one
Only one
It depends on the design
19
Which of the following best describes the MVC pattern in GUI applications?
Method-Variable-Container
Model-View-Controller
Main-Visual-Class
Monitor-Value-Counter
20
What class must all exceptions inherit from?
Throwable
Object
RuntimeError
ExceptionManager
21
Which of the following is TRUE about Errors in Java?
They are outside the control of the user or programmer
They can always be handled
They are always recovered by garbage collection
They occur due to incorrect syntax
22
Which of the following is NOT an example of why an exception may occur?
Down server problem
Correct user input
Network connectivity issues
Accessing a missing file
23
Which inheritance type can lead to ambiguity due to multiple parent classes?
Multiple Inheritance
Hierarchical Inheritance
Single Inheritance
Multi-level Inheritance
24
What is the purpose of a Graphical User Interface (GUI) in software development?
To manage network protocols
To improve backend performance
To encrypt user data
To allow users to interact visually with the system
25
What type of exception is checked by the compiler at compile time?
Error
Checked Exception
Runtime Exception
Logical Exception
26
10. What is the correct order of the Java Exception Hierarchy?
Throwable → Exception → RuntimeError
RuntimeError → Throwable → Error
Exception → Throwable → Error
Throwable → Error → Exception
27
What is the function of the DAO (Data Access Object) pattern in OOP-based database applications?
Handles UI rendering
Stores user credentials
Encapsulates the logic for database access
Formats output data
28
Which GUI layout manager in Java arranges components in a single row or column?
GridLayout
BorderLayout
FlowLayout
BoxLayout
29
Which CRUD operation is used to add new records to a database?
Delete
Create
Update
Read
30
What does CRUD stand for in database operations?
Code, Run, Update, Deploy
Create, Read, Update, Delete
Call, Return, Update, Destroy
Connect, Retrieve, Upload, Download
31
What block is always executed whether an exception occurs or not?
catch
throw
finally
try
32
Why are abstract classes used?
To increase memory usage
To provide complete implementation
To replace interfaces
To define common base behavior and enforce method implementation
33
Which inheritance type involves a parent-child-grandchild relationship?
Single Inheritance
Hierarchical Inheritance
Multiple Inheritance
Multi-level Inheritance
34
Which SQL statement corresponds to the "Read" operation in CRUD?
INSERT
SELECT
UPDATE
DELETE
35
Which of the following is a component of a GUI?
Button
Database
API
Compiler
36
What is an abstract class?
A class that cannot have methods
A class with only static methods
A class that cannot be instantiated
A class that can only have abstract methods
37
What does the term "event-driven programming" mean in the context of GUI development?
The program runs without user interaction
The program executes in a batch process
Program flow is determined by user actions like clicks or keypresses
The program only logs events
38
Which inheritance type is best for representing “is-a” relationships in tiers (e.g., Animal → Mammal → Dog)?
Multiple Inheritance
Multi-level Inheritance
Single Inheritance
Hierarchical Inheritance
39
What is a major benefit of using exception handling in applications?
To replace all conditional statements
To avoid system termination due to unexpected events
To convert compile-time errors into runtime errors
To detect syntax errors
40
Which of the following GUI components allows users to input text?
JLabel
JRadioButton
JButton
JTextField
41
In Object-Oriented Programming, how is a database record often represented?
As an object
As a variable
As an exception
As a method
42
In OOP, what is typically used to represent GUI components like buttons, text fields, and labels?
Pointers
Functions
Arrays
Objects
43
Which of the following can an abstract class contain?
Both abstract and non-abstract methods
Only variables
Only abstract methods
Only concrete methods
44
In OOP-based database programming, what class type is typically responsible for interacting with the database?
UI Class
Entity Class
Controller
Database Helper or DAO (Data Access Object)
45
What is the main difference between Hierarchical and Multiple Inheritance?
Number of child classes
Number of parent classes
Use of interfaces
Number of abstract classes
46
Which keyword is used in a method declaration to indicate an exception might be thrown?
catch
throw
throws
try
47
What is the purpose of multiple catch blocks in Java?
To provide different handlers for different exception types
To handle all exceptions in one block
To handle syntax errors
To increase compilation speed
48
Which of the following statements is true?
Abstract classes can contain both defined and undefined methods.
An abstract class can be instantiated directly.
Abstract methods must have a body.
Abstract classes cannot be extended.
49
When do unchecked exceptions occur?
After compilation but before runtime
At compile time
At runtime
During design phase
50
Which of the following is NOT a feature of Hierarchical Inheritance?
One parent class
Shared base class functionality
Multiple parent classes
Multiple subclasses