Class 12

Information Technology (802)

351 questions available

Refine

All questions

351 results
221

Which of these would cause a runtime exception in Java?

MCQ Medium
a. Declaring a variable
b. Dividing an integer by zero
c. Writing a comment
d. Creating an object
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
Dividing an integer by zero
Explanation: Dividing an integer by zero causes an ArithmeticException at runtime; this does NOT happen with floating point division (which results in Infinity).
222

In traditional file processing systems, the problem where the same information is stored in more than one file is called:

MCQ Easy
a. Data Inconsistency
b. Data Redundancy
c. Lack of Data Integration
d. Referential Integrity Violation
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
Data Redundancy
Explanation: Data Redundancy occurs when the same information is stored in more than one file, wasting space.
223

Which keyword surrounds the part of the code that might generate an exception?

MCQ Easy
a. catch
b. try
c. finally
d. throw
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
try
Explanation: The try block surrounds the part of the code that can potentially generate exceptions.
224

If a file is updated but other files containing similar information are not updated, this results in:

MCQ Medium
a. Data Redundancy
b. Data Inconsistency
c. Data Integration
d. Concurrency Control
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
Data Inconsistency
Explanation: Data Inconsistency occurs when related files are not updated together, causing conflicting information across files.
225

Which keyword defines a block containing the exception handler code, executed when a matching exception occurs?

MCQ Easy
a. try
b. catch
c. finally
d. import
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
catch
Explanation: A catch block contains the exception handler code that executes when its argument type matches the thrown exception.
226

A Database Management System (DBMS) is best described as:

MCQ Easy
a. A single database table
b. A collection of programs that enables users to create, maintain and use a database
c. A programming language like Java
d. A type of computer hardware
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
A collection of programs that enables users to create, maintain and use a database
Explanation: A DBMS is a collection of programs that enables users to create, maintain, and use a database, providing a single repository accessed by different users.
227

Which block is ALWAYS executed when a try block exits, whether or not an exception occurred?

MCQ Medium
a. catch
b. finally
c. throw
d. default
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
finally
Explanation: The optional finally block always executes when the try block exits, regardless of whether an exception occurred — often used for cleanup code.
228

Which operation on a database involves specifying the data type and constraints of the data to be stored?

MCQ Medium
a. Populating the Database
b. Defining the Database
c. Sharing the Database
d. Protecting the Database
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
Defining the Database
Explanation: Defining the Database involves specifying the data type of the data to be stored and any constraints on it.
229

Which method of the Exception class is used to print/retrieve the error message that caused an exception?

MCQ Medium
a. getError()
b. getMessage()
c. printError()
d. toString() only
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
getMessage()
Explanation: The getMessage() method of the Exception class returns the error message describing what caused the exception.
230

Storing data on some storage medium controlled by the DBMS is called:

MCQ Medium
a. Defining the Database
b. Populating the Database
c. Manipulating the Database
d. Maintaining the Database
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
Populating the Database
Explanation: Populating the Database involves storing the actual data on a storage medium controlled by the DBMS.
231

If multiple catch blocks follow a try block, what determines which catch block executes?

MCQ Medium
a. The first catch block always executes
b. The catch block whose argument type matches the type of the thrown exception object
c. All catch blocks execute in sequence
d. The last catch block always executes
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
The catch block whose argument type matches the type of the thrown exception object
Explanation: When an exception is thrown, control passes to the catch block whose argument type matches the type of the exception object.
232

The description of data (structure and constraints) stored in a database catalogue/data dictionary is called:

MCQ Medium
a. A Tuple
b. Meta-data
c. A Domain
d. A Schema Diagram
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
Meta-data
Explanation: Meta-data is the description of data stored by the DBMS, kept in a database catalogue or data dictionary.
233

Which Java package contains the classes needed to connect a Java program to a database (e.g., Connection, Statement, ResultSet)?

MCQ Medium
a. java.util
b. java.lang
c. java.sql
d. java.io
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
java.sql
Explanation: The java.sql package contains the classes required for database connectivity, such as Connection, Statement, and ResultSet.
234

The DBMS property that allows a change in the structure of data (in the catalogue) without needing to modify the programs that access the data is called:

MCQ Medium
a. Data Redundancy
b. Program-Data Independence
c. Referential Integrity
d. Data Duplication
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
Program-Data Independence
Explanation: Since data definition is stored separately (in the catalogue), changes to data structure need not require modification of application programs — this is Program-Data Independence.
235

Which class's getConnection() method is used to establish a connection to a database?

MCQ Medium
a. Statement
b. ResultSet
c. DriverManager
d. Scanner
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
DriverManager
Explanation: DriverManager.getConnection(url, username, password) is used to establish a connection to a database.
236

Which type of DBMS user is responsible for authorizing access, monitoring use, and acquiring software/hardware resources?

MCQ Easy
a. End User
b. Database Administrator (DBA)
c. Application Programmer
d. System Analyst
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
Database Administrator (DBA)
Explanation: The Database Administrator (DBA) administers the database and DBMS, authorizes access, and acquires resources.
237

Which three parameters are typically required to establish a database connection via getConnection()?

MCQ Medium
a. Table name, column name, data type
b. URL of the database, username, and password
c. Class name, method name, object name
d. Query, result, exception
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
URL of the database, username, and password
Explanation: getConnection() requires the URL of the database, a username, and a password to connect.
238

Which type of DBMS user determines the requirements of end users and develops specifications to meet them?

MCQ Medium
a. End User
b. DBA
c. Application Programmer
d. System Analyst
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
System Analyst
Explanation: The System Analyst determines end-user requirements and develops specifications, playing a major role in database design.
239

Which method of the Connection object returns a Statement object used for sending SQL statements to the database?

MCQ Medium
a. executeQuery()
b. createStatement()
c. getConnection()
d. next()
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
createStatement()
Explanation: The createStatement() method of the Connection object returns a Statement object used to send SQL statements.
240

Which of these is an advantage of using the DBMS approach?

MCQ Easy
a. Increased data redundancy
b. Reduction in redundancy and improved consistency
c. Higher dependency on computer specialists
d. Reduced data availability
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
Reduction in redundancy and improved consistency
Explanation: The DBMS approach reduces redundancy (central repository) and improves consistency since there's a single copy of data accessed by all users.