Web Design and Development MCQs with Answers
Practice important Web Design and Development MCQs with answers and explanations.
Chapter: 6
Q101:
What is a key feature of the AddressBook class in the example?
A. It uses an ArrayList to store records
B. It uses a HashMap to store records
C. It supports fixed-size records
D. It requires explicit size management
Correct Answer:
A
Chapter: 7
Q102:
How does the AddressBook class perform searching?
A. By iterating over the ArrayList
B. By using a HashMap
C. By directly accessing elements
D. By using a LinkedList
Correct Answer:
A
Chapter: 7
Q103:
What does the print() method in the PersonInfo class do?
A. Prints details to the console
B. Displays details in a message dialog box
C. Writes details to a file
D. Logs details to a database
Correct Answer:
B
Chapter: 7
Q104:
How are records stored in the AddressBook class?
A. As instances of the PersonInfo class
B. As strings
C. As integers
D. As key-value pairs
Correct Answer:
A
Chapter: 7
Q105:
What are the three main types of errors in software development?
A. Syntax, Logic, Runtime
B. Syntax, Compilation, Runtime
C. Syntax, Logic, Compilation
D. Syntax, Compilation, Debugging
Correct Answer:
A
Chapter: 7
Q106:
What is an exception in Java?
A. A method that handles errors
B. A runtime error that stops program execution
C. A runtime event wrapped as an object
D. A syntax error detected during compilation
Correct Answer:
C
Chapter: 7
Q107:
Which of the following is an example of a runtime error?
A. Division by zero
B. Invalid method call
C. Missing class file
D. Uninitialized variable
Correct Answer:
A
Chapter: 7
Q108:
What does the 'finally' block in Java do?
A. It executes only if an exception is thrown
B. It always executes regardless of whether an exception is thrown
C. It executes before the 'try' block
D. It executes after the 'catch' block
Correct Answer:
B
Chapter: 7
Q109:
What keyword is used to manually throw an exception in Java?
A. catch
B. throw
C. throws
D. final
Correct Answer:
B
Chapter: 7
Q110:
In Java, what does the 'throws' keyword do?
A. It catches an exception
B. It declares that a method might throw an exception
C. It handles an exception
D. It creates a new exception
Correct Answer:
B
Chapter: 7
Q111:
What type of exception must be caught or declared in a method signature?
A. Unchecked Exception
B. Checked Exception
C. Runtime Exception
D. Error
Correct Answer:
B
Chapter: 8
Q112:
Exceptions must be handled while handling files otherwise it may lead to _____
A. Logical error
B. Syntax error
C. Run-time error
D. No error
Correct Answer:
C
Chapter: 8
Q113:
Which of following can be thrown using the throw statement?
A. Error
B. Throwable
C. Exception
D. RuntimeException
Correct Answer:
B
Chapter: 8
Q114:
____________is/are the JSP Implicit Object(s).
A. session
B. application
C. config
D. All of Given
Correct Answer:
D
Chapter: 8
Q115:
JavaBeans are?
A. A special Java class file
B. Servlets
C. Applets
D. A Special form of JSP
Correct Answer:
D
Chapter: 8
Q116:
Overloading is _______ whereas overriding is _____
A. Run time binding, compile time binding
B. Late binding, compile time binding
C. Compile time binding, run time binding
D. Run time binding, late time binding
Correct Answer:
C
Chapter: 8
Q117:
Static methods only access ___
A. instance variable
B. instance method
C. static variables and methods
D. both static and instance members
Correct Answer:
C
Chapter: 8
Q118:
Which of the following is modifier is provided by default if no access is written explicitly?
A. public
B. Private
C. Protected
D. Default
Correct Answer:
D
Chapter: 8
Q119:
Which of the following is used for inheritance in java?
A. implements
B. extends
C. : (colon)
D. inherit
Correct Answer:
B
Chapter: 8
Q120:
A collection can store..........
A. Homogenous objects
B. Heterogeneous objects
C. Objects as well as primitive values
D. At most 100 objects
Correct Answer:
B