A question bank for every class and subject

Practice questions, with answers and explanations included

794 questions available

Refine

All questions

794 results
561

The float data type in Java occupies 8 bytes of memory.

TRUE FALSE Medium
a. TRUE
b. FALSE
Information Technology (802) · Class 11 · Sep 26, 2026
Show answer
FALSE
Explanation: The float data type occupies 4 bytes (32 bits); it is the double data type that occupies 8 bytes.
562

Write the SQL statement to delete the table named 'Orders' from the database.

SHORT Easy
Information Technology (802) · Class 11 · Sep 26, 2026
Show answer
Explanation: DROP TABLE Orders;
563

What does Arrays.binarySearch() return if the key element is NOT found in the array?

MCQ Medium
a. 0
b. -1
c. null
d. The array length
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
-1
Explanation: If the key is not found, the binarySearch() method returns -1.
564

Object Oriented Programming allows wrapping of data and methods together into a single unit, known as data encapsulation.

TRUE FALSE Easy
a. TRUE
b. FALSE
Information Technology (802) · Class 11 · Sep 26, 2026
Show answer
TRUE
Explanation: Data encapsulation is a key feature of OOP where data members and methods are wrapped together within a class.
565

Write the SQL statement to add a new column 'Games' of type VARCHAR(20) to the table 'Student'.

SHORT Medium
Information Technology (802) · Class 11 · Sep 26, 2026
Show answer
Explanation: ALTER TABLE Student ADD Games VARCHAR(20);
566

Which String class method converts all characters of a string to uppercase?

MCQ Easy
a. toUpperCase()
b. toLowerCase()
c. capitalize()
d. upper()
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
toUpperCase()
Explanation: The toUpperCase() method converts a String to all uppercase letters.
567

Inheritance in OOP allows a programmer to give a generic name to various methods or operators.

TRUE FALSE Medium
a. TRUE
b. FALSE
Information Technology (802) · Class 11 · Sep 26, 2026
Show answer
FALSE
Explanation: This describes Polymorphism, not Inheritance. Inheritance allows reuse of characteristics of an existing class in new classes.
568

Write the SQL statement to remove the column 'Games' from the table 'Student'.

SHORT Medium
Information Technology (802) · Class 11 · Sep 26, 2026
Show answer
Explanation: ALTER TABLE Student DROP Games;
569

For myString = "Hello World", what does myString.charAt(6) return?

MCQ Medium
a. H
b. W
c. o
d. d
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
W
Explanation: Index 6 in 'Hello World' (0-indexed: H-0,e-1,l-2,l-3,o-4, -5,W-6) corresponds to the character 'W'.
570

What is a Class in Object Oriented Programming?

SHORT Easy
Information Technology (802) · Class 11 · Sep 26, 2026
Show answer
Explanation: A class is used to encapsulate data (data members) and methods together in a single unit, with data members typically kept private/protected and methods kept public.
571

Write the SQL statement to modify the column 'games' in table 'Student' to be of type INTEGER.

SHORT Medium
Information Technology (802) · Class 11 · Sep 26, 2026
Show answer
Explanation: ALTER TABLE Student MODIFY games INTEGER;
572

For myString = "Hello World", what does myString.length() return?

MCQ Medium
a. 10
b. 11
c. 12
d. 5
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
11
Explanation: 'Hello World' has 11 characters including the space, so length() returns 11.
573

What is an Object in Object Oriented Programming?

SHORT Easy
Information Technology (802) · Class 11 · Sep 26, 2026
Show answer
Explanation: An object is an instance of a class that is capable of holding actual data in memory locations.
574

Which network device is used to connect individual nodes together such that all nodes connected through it form a single LAN?

MCQ Medium
a. Hub
b. Bridge
c. Switch
d. Gateway
Information Technology (802) · Class 11 · Sep 26, 2026
Show answer
Switch
Explanation: A switch connects individual nodes, each to a unique port, and forwards data only to the intended destination node; all nodes through a switch form one LAN.
575

Which String method checks if a string contains a given substring, returning true/false?

MCQ Easy
a. indexOf()
b. contains()
c. concat()
d. replace()
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
contains()
Explanation: The contains(String s) method returns true if the string contains the specified substring.
576

Explain the four numeric integer data types available in Java along with their storage sizes and ranges.

LONG Medium
Information Technology (802) · Class 11 · Sep 26, 2026
Show answer
Explanation: byte: 1 byte (8 bits), range -128 to 127. short: 2 bytes (16 bits), range -32768 to 32767. int: 4 bytes (32 bits), range -2^31 to +(2^31-1). long: 8 bytes (64 bits), range -2^63 to +(2^63-1). The choice of data type should be based on the range of values the variable is expected to hold.
577

Which of these best describes a 'node' in a computer network?

MCQ Easy
a. Only a personal computer
b. Any electronic device such as a computer, printer, or fax machine that communicates on the network
c. Only the central server
d. The cable connecting two devices
Information Technology (802) · Class 11 · Sep 26, 2026
Show answer
Any electronic device such as a computer, printer, or fax machine that communicates on the network
Explanation: Nodes or stations are electronic devices such as computers, printers, fax machines, and telephones that communicate by sending/receiving data.
578

Which String method compares two strings for equality WITHOUT considering case sensitivity?

MCQ Medium
a. equals()
b. equalsIgnoreCase()
c. compareTo()
d. matches()
Information Technology (802) · Class 12 · Sep 26, 2026
Show answer
equalsIgnoreCase()
Explanation: equalsIgnoreCase(String another) compares two strings for equality while ignoring case differences.
579

Write Java code (assume text fields jTextField1 for Principal, jTextField2 for Rate, jTextField3 for Time, and jTextField4 for the result) to calculate and display Simple Interest on the click of a button.

LONG Hard
Information Technology (802) · Class 11 · Sep 26, 2026
Show answer
Explanation: double Principal, Rate, SInterest; byte Time; Principal = Double.parseDouble(jTextField1.getText()); Rate = Double.parseDouble(jTextField2.getText()); Time = Byte.parseByte(jTextField3.getText()); SInterest = (Principal*Rate*Time)/100; jTextField4.setText(Double.toString(SInterest));
580

Which network category is used for communication among devices within about 10 meters of one person?

MCQ Easy
a. LAN
b. MAN
c. WAN
d. PAN
Information Technology (802) · Class 11 · Sep 26, 2026
Show answer
PAN
Explanation: A Personal Area Network (PAN) is used for communication among devices close to one person, typically within about 10 meters.