A question bank for every class and subject

Practice questions, with answers and explanations included

794 questions available

Refine

All questions

794 results
461

What does the 'static' modifier allow, when applied to a method?

MCQ Medium
a. The method to be called without creating an invoking object
b. The method to always return zero
c. The method to run only once ever
d. The method to be private
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
The method to be called without creating an invoking object
Explanation: The static modifier allows a method to be called without needing an invoking object (i.e., it can be called directly using the class name or from within the same class).
462

By default, records displayed using the ORDER BY clause (without DESC) are sorted in:

MCQ Easy
a. Descending order
b. Random order
c. Ascending order
d. Insertion order
Information Technology (802) · Class 11 · Sep 26, 2026
Show answer
Ascending order
Explanation: By default, ORDER BY sorts records in ascending order of the specified column unless DESC is specified.
463

Given: int a=11, b=22, c=33, d=11; Which of these relational expressions are TRUE? i) a==b ii) b!=d iii) c<=b iv) a<c v) a==d vi) c>a vii) a>=c

MCQ Hard
a. i, iv & vii
b. ii, iv, v & vi
c. ii, iv, vi & vii
d. iii, v, vi & vii
Information Technology (802) · Class 11 · Sep 26, 2026
Show answer
ii, iv, v & vi
Explanation: b!=d (22!=11) is true; a<c (11<33) is true; a==d (11==11) is true; c>a (33>11) is true. So ii, iv, v, and vi are true.
464

In a method call, the values supplied are copied into the method's:

MCQ Easy
a. Return statement
b. Parameters
c. Class name
d. Comments
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
Parameters
Explanation: The arguments supplied in a method call are copied into the method's corresponding parameters.
465

Which keyword provides a customized column heading in the output of a SELECT query without altering the table?

MCQ Medium
a. ALIAS
b. AS
c. NAME
d. LABEL
Information Technology (802) · Class 11 · Sep 26, 2026
Show answer
AS
Explanation: The AS keyword is used to give an alias name to a column in the SELECT output; it does not change the actual table.
466

Convert: 2 KB = ______ MB.

SHORT Medium
Information Technology (802) · Class 11 · Sep 26, 2026
Show answer
Explanation: 2 KB = 2 x 1024 MB = 2048 MB.
467

Array indices in Java range from 0 to n, where n is the size of the array.

TRUE FALSE Medium
a. TRUE
b. FALSE
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
FALSE
Explanation: Array indices range from 0 to n-1 for an array of size n, not 0 to n; using index n would cause an ArrayIndexOutOfBoundsException.
468

Which query correctly displays first names of students whose marks are either 88, 92, or 95?

MCQ Medium
a. SELECT fname FROM student WHERE marks LIKE (88,92,95);
b. SELECT fname FROM student WHERE marks IN (88,92,95);
c. SELECT fname FROM student WHERE marks BETWEEN 88 AND 95;
d. SELECT fname FROM student WHERE marks = (88,92,95);
Information Technology (802) · Class 11 · Sep 26, 2026
Show answer
SELECT fname FROM student WHERE marks IN (88,92,95);
Explanation: The IN operator is used to match a column against a specific set of listed values, e.g., marks IN (88,92,95).
469

Convert: 3 KB = ______ MB.

SHORT Medium
Information Technology (802) · Class 11 · Sep 26, 2026
Show answer
Explanation: 3 KB = 3 x 1024 MB = 3072 MB.
470

A method's parameter list acts like regular local variables within the method body.

TRUE FALSE Medium
a. TRUE
b. FALSE
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
TRUE
Explanation: Parameters behave like local variables scoped to the method body, receiving copies of the arguments passed during the call.
471

Which command is used to insert a new row into a table?

MCQ Easy
a. INSERT INTO
b. ADD INTO
c. APPEND INTO
d. CREATE INTO
Information Technology (802) · Class 11 · Sep 26, 2026
Show answer
INSERT INTO
Explanation: INSERT INTO <table>(<columns>) VALUES (values); is used to insert a new row into a table.
472

Convert: 4 KB = ______ MB.

SHORT Medium
Information Technology (802) · Class 11 · Sep 26, 2026
Show answer
Explanation: 4 KB = 4 x 1024 MB = 4096 MB.
473

How do you declare and initialize an array of 5 doubles named 'marks' with size specified separately from declaration?

SHORT Easy
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
Explanation: double[] marks; marks = new double[5]; (or in one line: double[] marks = new double[5];)
474

The '*' symbol in a SELECT statement is used to display all columns of a table.

TRUE FALSE Easy
a. TRUE
b. FALSE
Information Technology (802) · Class 11 · Sep 26, 2026
Show answer
TRUE
Explanation: SELECT * FROM <table>; retrieves and displays all columns of the specified table.
475

Convert: 5 KB = ______ MB.

SHORT Medium
Information Technology (802) · Class 11 · Sep 26, 2026
Show answer
Explanation: 5 KB = 5 x 1024 MB = 5120 MB.
476

Write the syntax structure of a user-defined method in Java.

SHORT Medium
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
Explanation: return_type method_name(list of parameters separated by commas) { statements; return statement; }
477

Using WHERE clause conditions in a SELECT statement permanently changes the values stored in the table.

TRUE FALSE Medium
a. TRUE
b. FALSE
Information Technology (802) · Class 11 · Sep 26, 2026
Show answer
FALSE
Explanation: Calculations or filters applied via SELECT only affect the displayed result set; the actual table data remains unchanged unless UPDATE is used.
478

Convert: 2 MB = ______ GB.

SHORT Medium
Information Technology (802) · Class 11 · Sep 26, 2026
Show answer
Explanation: 2 MB = 2 x 1024 GB = 2048 GB.
479

Write a static Java method 'rectangle_area' that takes length and breadth (both double) as parameters and returns the area of the rectangle. Also show how to call it from main and store the result.

LONG Medium
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
Explanation: static double rectangle_area(double length, double breadth) { return (length * breadth); } To call it: double a = rectangle_area(45.5, 78.5); System.out.println("Area of the rectangle = "+a);
480

If no WHERE condition is specified with the DELETE statement, all records in the table are removed.

TRUE FALSE Medium
a. TRUE
b. FALSE
Information Technology (802) · Class 11 · Sep 26, 2026
Show answer
TRUE
Explanation: DELETE FROM <table>; without a WHERE clause removes all records, leaving the table structure intact but empty.