Question bank

Class 12

1 subject · 351 questions

Refine

All questions

351 results
261

By default, are Java assertions enabled or disabled at runtime?

MCQ Medium
a. Enabled by default
b. Disabled by default (must be enabled with the -ea option)
c. Always enabled and cannot be disabled
d. Only enabled in NetBeans
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
Disabled by default (must be enabled with the -ea option)
Explanation: Assertions are disabled by default (since they reduce runtime performance); they can be enabled using the -ea command-line option.
262

A minimal superkey — one from which no attribute can be removed without losing the uniqueness property — is called a:

MCQ Medium
a. Foreign key
b. Key (Candidate Key)
c. Domain
d. Attribute
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
Key (Candidate Key)
Explanation: A Key is the minimal superkey; removing any attribute from it would cause it to lose its uniqueness (no longer remain a superkey). This is also called a Candidate Key.
263

A program that can perform multiple tasks concurrently using independent parts is called:

MCQ Easy
a. A sequential program
b. A multithreaded program
c. A single-task program
d. An assertion-based program
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
A multithreaded program
Explanation: A multithreaded program consists of two or more threads, each executing a different task independently and concurrently.
264

If a relation has multiple candidate keys, one of them is designated as the:

MCQ Easy
a. Foreign Key
b. Primary Key
c. Super Key
d. Alternate Key
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
Primary Key
Explanation: One of the candidate keys is designated as the Primary Key, preferably the one with the least number of attributes, and is used to identify tuples in the relation.
265

Which of these is one of the two ways to create a thread in Java?

MCQ Easy
a. Extending the Thread class
b. Extending the Scanner class
c. Implementing the Exception interface
d. Creating a static method
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
Extending the Thread class
Explanation: A thread can be created either by extending the Thread class, or by implementing the Runnable interface.
266

Which constraint specifies that the value of every attribute in a tuple must come from the domain of that attribute?

MCQ Medium
a. Key Constraint
b. Domain Constraint
c. Entity Integrity Constraint
d. Referential Integrity Constraint
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
Domain Constraint
Explanation: The Domain Constraint requires that every attribute value in a tuple must be a value from that attribute's domain (e.g., an Employee_ID must be a 4-digit number).
267

Which method must be overridden when creating a thread class (whether extending Thread or implementing Runnable)?

MCQ Medium
a. main()
b. run()
c. start()
d. execute()
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
run()
Explanation: The run() method is the entry point for a new thread and must be overridden with the code the thread should execute.
268

Which constraint specifies that the primary key of a relation cannot have a NULL value?

MCQ Medium
a. Domain Constraint
b. Null Value Constraint
c. Entity Integrity Constraint
d. Key Constraint
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
Entity Integrity Constraint
Explanation: The Entity Integrity Constraint specifies that the primary key of a relation cannot have a NULL value, since a primary key must uniquely identify each tuple.
269

Which method is called to actually START the execution of a thread (after creating it)?

MCQ Medium
a. run()
b. start()
c. execute()
d. begin()
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
start()
Explanation: The start() method of the Thread class is called to begin execution of the thread.
270

A constraint specified between two relations, involving a foreign key referencing a primary key of another relation, is called:

MCQ Medium
a. Domain Constraint
b. Entity Integrity Constraint
c. Referential Integrity Constraint
d. Null Value Constraint
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
Referential Integrity Constraint
Explanation: The Referential Integrity Constraint ensures data entered in one relation (via a foreign key) is consistent with data in another (referenced) relation.
271

Which method of the Thread class causes it to suspend execution for a specified number of milliseconds?

MCQ Medium
a. wait()
b. sleep()
c. pause()
d. stop()
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
sleep()
Explanation: The sleep() method causes a thread to suspend execution for the specified number of milliseconds.
272

A foreign key value, according to the referential integrity constraint, must either:

MCQ Medium
a. Always be zero
b. Occur as a value of the primary key in the referenced relation, or be NULL
c. Always be a duplicate value
d. Never match the primary key
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
Occur as a value of the primary key in the referenced relation, or be NULL
Explanation: The value of a foreign key attribute must either occur as a value of the primary key in some tuple of the referenced relation, or be NULL.
273

Classes created by extending the Thread class cannot be extended further; which alternative method of thread creation avoids this limitation?

MCQ Hard
a. Implementing the Runnable interface
b. Using the assert statement
c. Using a static method
d. Using an array
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
Implementing the Runnable interface
Explanation: Implementing the Runnable interface (rather than extending Thread) allows the class to still be extended further, since Java doesn't support multiple inheritance of classes.
274

In a table where a foreign key references the primary key of the SAME table (e.g., Manager_ID referencing Employee_ID), the table is called a:

MCQ Hard
a. Referenced table
b. Self-referencing table
c. Composite table
d. Domain table
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
Self-referencing table
Explanation: When a foreign key constraint references columns within the same table, the table is called a self-referencing table.
275

A wrapper class in Java is used to:

MCQ Medium
a. Wrap a primitive data type into an object of that class
b. Convert a class into a primitive type
c. Create arrays
d. Handle exceptions
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
Wrap a primitive data type into an object of that class
Explanation: A wrapper class wraps a primitive datatype (like int) into an object of a corresponding class (like Integer), useful when reference semantics are needed.
276

A relation can have more than one key (candidate key), but only one is chosen as the primary key.

TRUE FALSE Medium
a. TRUE
b. FALSE
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
TRUE
Explanation: A relation may have multiple candidate keys (e.g., Aadhar_number, PAN, Voter_ID in a PERSON relation), but only one is designated the primary key.
277

Which wrapper class corresponds to the primitive data type 'boolean'?

MCQ Easy
a. Bool
b. Boolean
c. Bit
d. Flag
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
Boolean
Explanation: The Boolean class is the wrapper class for the boolean primitive data type.
278

The set of all attributes of a relation is always a valid superkey.

TRUE FALSE Medium
a. TRUE
b. FALSE
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
TRUE
Explanation: The combination of all attributes in a relation is always a superkey by definition, since no two tuples can have identical values across all attributes.
279

Which wrapper class corresponds to the primitive data type 'char'?

MCQ Easy
a. Char
b. Character
c. String
d. Symbol
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
Character
Explanation: The Character class is the wrapper class for the char primitive data type.
280

Referential integrity requires that the foreign key attribute and referenced primary key attribute must have the same name.

TRUE FALSE Medium
a. TRUE
b. FALSE
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
FALSE
Explanation: It is NOT necessary for the foreign key to have the same name as the referenced primary key attribute; only the domain must match.