MCQOPTIONS
Saved Bookmarks
This section includes 177 Mcqs, each offering curated multiple-choice questions to sharpen your Technical Programming knowledge and support exam preparation. Choose a topic below to get started.
| 151. |
Which one is the default scope of the beans? |
| A. | Prototype |
| B. | Session |
| C. | Request |
| D. | Singleton |
| Answer» E. | |
| 152. |
Which attribute is used to set the scope of the bean? |
| A. | setScope |
| B. | scope |
| C. | getScope |
| D. | none of the mentioned |
| Answer» C. getScope | |
| 153. |
A bean can be requested by:- |
| A. | getBean method |
| B. | reference from another bean using autowiring, property etc |
| C. | all of the mentioned |
| D. | none of the mentioned |
| Answer» D. none of the mentioned | |
| 154. |
The Spring Expression Language can be accessed by:- |
| A. | XML configuration |
| B. | Annotations |
| C. | None of the mentioned |
| D. | All of the mentioned |
| Answer» E. | |
| 155. |
We can combine target Object and propertyPath properties as bean name/id of PropertyPathFactoryBean. |
| A. | True |
| B. | False |
| Answer» B. False | |
| 156. |
Alternate way of PropertyPathFactoryBean to declare a bean. |
| A. | util:property-path tag |
| B. | util:constant tag |
| C. | None of the mentioned |
| D. | All of the mentioned |
| Answer» B. util:constant tag | |
| 157. |
The propertyPath property of PropertyPathFactoryBean can accept only a single property name. |
| A. | True |
| B. | False |
| Answer» C. | |
| 158. |
PropertyPathFactoryBean declares a bean from an:- |
| A. | Object Property |
| B. | Property Path |
| C. | All of the mentioned |
| D. | None of the mentioned |
| Answer» D. None of the mentioned | |
| 159. |
Inner Bean can be retrieved by it’s name. |
| A. | True |
| B. | False |
| Answer» C. | |
| 160. |
Declaring bean form object properties can be done using:- |
| A. | PropertyPathFactoryBean |
| B. | util:constant |
| C. | None of the mentioned |
| D. | All of the mentioned |
| Answer» B. util:constant | |
| 161. |
Which tag is also allowed by static field? |
| A. | util:constant |
| B. | list |
| C. | set |
| D. | constructor-args |
| Answer» B. list | |
| 162. |
As an alternative to specifying the field name in the staticField property explicitly, you can set it as the bean name of FieldRetrievingFactoryBean. |
| A. | True |
| B. | False |
| Answer» B. False | |
| 163. |
Declaring a bean from a static field requires a built-in factory bean FieldRetrievingFactoryBean and fully qualified field name or instance field is specified in the list property. |
| A. | True |
| B. | False |
| Answer» C. | |
| 164. |
Ways to declare bean from a static field? |
| A. | FieldRetrievingFactoryBean |
| B. | util:contant |
| C. | All of the mentioned |
| D. | None of the mentioned |
| Answer» D. None of the mentioned | |
| 165. |
Declaring Beans using:- |
| A. | Static field |
| B. | Object Properties |
| C. | All of the mentioned |
| D. | None of the mentioned |
| Answer» D. None of the mentioned | |
| 166. |
Which Attribute is used to specify the bean declared? |
| A. | factory-bean |
| B. | scope |
| C. | getBean |
| D. | declareBean |
| Answer» B. scope | |
| 167. |
Instance Factory method main purpose is to encapsulate the object-creation process in a method of another object instance. |
| A. | BeanCreationException |
| B. | IllegalArgumentException |
| C. | New Product will be created |
| D. | None of the mentioned |
| Answer» D. None of the mentioned | |
| 168. |
One factory class can also hold more than one factory method True/False? |
| A. | True |
| B. | False |
| Answer» B. False | |
| 169. |
The bean instance is mentioned by the factory-method attribute, while the factory method is signified by the factory-bean attribute? |
| A. | True |
| B. | False |
| Answer» C. | |
| 170. |
Bean’s naming convention:- starts with lowercase, camelcase from then on.? |
| A. | True |
| B. | False |
| Answer» B. False | |
| 171. |
A bean can have more than one name using multiple id attributes? |
| A. | True |
| B. | False |
| Answer» B. False | |
| 172. |
Exception thrown by factory method? |
| A. | IllegalArgumentException |
| B. | IndexOutofBoundException |
| C. | ClassPathNotFoundException |
| D. | BeanCreationException |
| Answer» E. | |
| 173. |
Purpose of Static Factory Method? |
| A. | Static method to create an object |
| B. | Initialize bean |
| C. | All of the mentioned |
| D. | None of the mentioned |
| Answer» B. Initialize bean | |
| 174. |
Which attribute is used to specify static factory-method? |
| A. | factory-method |
| B. | default-init method |
| C. | destroy method |
| D. | lazy-init method |
| Answer» B. default-init method | |
| 175. |
Which of the following method can be used to used to instantiate a method? |
| A. | static factory method |
| B. | default-init method |
| C. | destroy method |
| D. | lazy-init method |
| Answer» B. default-init method | |
| 176. |
Which attribute is used to specify class name of the bean? |
| A. | name |
| B. | id |
| C. | class |
| D. | constructor-args |
| Answer» D. constructor-args | |
| 177. |
Beans can be created by which of the following properties? |
| A. | Scope |
| B. | Property |
| C. | Class |
| D. | It’s own constructor |
| Answer» E. | |