Skip to main content

Web Design and Development MCQs with Answers

Practice important Web Design and Development MCQs with answers and explanations.

Chapter: 16
Q241:
What does a ResultSet contain in Java?
A. A database connection
B. A table schema
C. The results of a SQL query
D. A SQL query
Correct Answer: C
Chapter: 16
Q242:
How does a default ResultSet object behave?
A. It is updatable and scrollable
B. It is forward-only and not updatable
C. It is read-only and scrollable
D. It can be updated but not scrolled
Correct Answer: B
Chapter: 16
Q243:
Which method is used to move the cursor to the next row in a ResultSet?
A. getRow()
B. moveToInsertRow()
C. previous()
D. next()
Correct Answer: D
Chapter: 16
Q244:
The _______ method must be implemented by all threads.
A. wait()
B. start()
C. stop()
D. run()
Correct Answer: D
Chapter: 16
Q245:
What does the next() method of ResultSet return?
A. The current row number
B. A boolean indicating if there is a next row
C. The data in the current row
D. The previous row's data
Correct Answer: B
Chapter: 16
Q246:
What is the purpose of the close() method in ResultSet?
A. To release JDBC and database resources
B. To retrieve data from the ResultSet
C. To update the ResultSet
D. To move the cursor to the previous row
Correct Answer: A
Chapter: 16
Q247:
What does the absolute(int row) method do in a ResultSet?
A. Moves the cursor to the specified row number
B. Moves the cursor to the previous row
C. Moves the cursor to the first row
D. Moves the cursor to the last row
Correct Answer: A
Chapter: 16
Q248:
Which of these can be used to identify a thread?
A. Thread Id
B. Thread Name
C. Thread Priority
D. All of the above
Correct Answer: D
Chapter: 16
Q249:
Which of these can be used to serialize an object?
A. FileOutputStream
B. ObjectOutputStream
C. ObjectInputStream
D. FileInputStream
Correct Answer: B
Chapter: 16
Q250:
Which of these is a correct statement about a thread?
A. start() method waits until run() method finishes
B. run() method waits until start() method finishes
C. start() method creates a new thread and calls code written inside run() method
D. start() method returns the result to run() method
Correct Answer: C
Chapter: 16
Q251:
In java, threads can be created by implementing which of the following?
A. Runnable Interface
B. Abstract class
C. Runnable Interface or Extending Thread Class
D. Extending Thread class
Correct Answer: C
Chapter: 16
Q252:
If the start method is not called, what happens?
A. Nothing will happen
B. Thread will be created
C. Thread will be created but not executed
D. Thread will run immediately
Correct Answer: C
Chapter: 16
Q253:
_______ is the process of storing the state of an object in a byte stream.
A. Encapsulation
B. Abstraction
C. Serialization
D. None of the above
Correct Answer: C
Chapter: 16
Q254:
Which of these classes are used for handling binary data?
A. FileOutputStream
B. DataInputStream
C. ObjectOutputStream
D. All of the above
Correct Answer: D
Chapter: 16
Q255:
What happens if a java object is serialized to a file that already exists?
A. Exception is thrown
B. File is overwritten
C. File is deleted
D. None of the above
Correct Answer: B
Chapter: 16
Q256:
What is the extension of the file created by ObjectOutputStream?
A. .txt
B. .java
C. .ser
D. .out
Correct Answer: C
Chapter: 16
Q257:
________ is the method of writing objects to a file.
A. write()
B. writeObject()
C. writeStream()
D. None of the above
Correct Answer: B
Chapter: 16
Q258:
___________ is used to get an object from a file
A. read()
B. readObject()
C. readStream()
D. None of the above
Correct Answer: B
Chapter: 16
Q259:
What happens if we try to deserialize a file that contains more than one object?
A. Only the first object is deserialized
B. All objects are deserialized
C. Only the last object is deserialized
D. Exception is thrown
Correct Answer: B
Chapter: 16
Q260:
__________ is a process of getting an object from a file.
A. writeObject()
B. readObject()
C. read()
D. None of the above
Correct Answer: B

Test Your Knowledge

Take a timed quiz on Web Design and Development

🚀 Start Quiz Now