1. Which of the following operators is used for logical AND in Java?
A. &&
B. ||
C. &
D. and
Answer: A
Rationale: && is the logical AND operator in Java.
2. Which of the following data types is immutable in Python?
A. List
B. Dictionary
C. String
D. Set
Answer: C
Rationale: In Python, strings are immutable, meaning their values cannot be
changed after creation.
,3. Which of the following is the most suitable definition of a function in
programming?
A. A function is a block of code that performs a specific task.
B. A function is used to store data.
C. A function is a sequence of statements that produce output.
D. A function is a method for creating variables.
Answer: A
Rationale: A function is a block of code that performs a specific task and can be
reused throughout the program.
4. In Java, which method is used to start a thread?
A. run()
B. execute()
C. start()
D. init()
Answer: C
Rationale: The start() method is used to begin the execution of a thread in Java.
, 5. What is the default value of a variable of type int in Java?
A. 0
B. null
C. 1
D. undefined
Answer: A
Rationale: The default value of an int in Java is 0.
6. Which of the following is a type of sorting algorithm?
A. Bubble Sort
B. Linked List
C. Hash Map
D. Set
Answer: A
Rationale: Bubble Sort is a well-known sorting algorithm used to order elements in
a list or array.
A. &&
B. ||
C. &
D. and
Answer: A
Rationale: && is the logical AND operator in Java.
2. Which of the following data types is immutable in Python?
A. List
B. Dictionary
C. String
D. Set
Answer: C
Rationale: In Python, strings are immutable, meaning their values cannot be
changed after creation.
,3. Which of the following is the most suitable definition of a function in
programming?
A. A function is a block of code that performs a specific task.
B. A function is used to store data.
C. A function is a sequence of statements that produce output.
D. A function is a method for creating variables.
Answer: A
Rationale: A function is a block of code that performs a specific task and can be
reused throughout the program.
4. In Java, which method is used to start a thread?
A. run()
B. execute()
C. start()
D. init()
Answer: C
Rationale: The start() method is used to begin the execution of a thread in Java.
, 5. What is the default value of a variable of type int in Java?
A. 0
B. null
C. 1
D. undefined
Answer: A
Rationale: The default value of an int in Java is 0.
6. Which of the following is a type of sorting algorithm?
A. Bubble Sort
B. Linked List
C. Hash Map
D. Set
Answer: A
Rationale: Bubble Sort is a well-known sorting algorithm used to order elements in
a list or array.