1. What is the output of the following Python code snippet?
```python
x = 10
y = 50
if x ** 2 > 100 and y < 100> 100` is false because 10 squared is 100, not
greater than 100.
2. In Java, which of the following is used to handle an array index that is
out of bounds?
A) try-catch block
B) if-else statement
C) do-while loop
D) for-each loop
Answer: A) try-catch block
Rationale: An ArrayIndexOutOfBoundsException is a runtime exception
that can be handled using a try-catch block to maintain the flow of
program execution.
3. Which data type would be best for storing a person's telephone number
in a database?
A) Integer
B) String
C) Float
D) Boolean
Answer: B) String
Category | exam bundles |
Comments | 0 |
Rating | |
Sales | 0 |