Explore topic-wise MCQs in Spring.

This section includes 20 Mcqs, each offering curated multiple-choice questions to sharpen your Spring knowledge and support exam preparation. Choose a topic below to get started.

1.

Which event is provoked when web request comes into action

A. ContextClosedEvent
B. ContextStoppedEvent
C. SessionEvent
D. RequestHandledEvent
Answer» E.
2.

Which of the following is a well known recognized event

A. ContextCloasedEvemt
B. ContextRefreshedEvent
C. RequestHandledEvent
D. All of the mentioned
Answer» E.
3.

Which method is used to publish your own custom event

A. contextPublish
B. publishEvent
C. applicationEventPublish
D. addEvent
Answer» C. applicationEventPublish
4.

Which interface is used to listen to certain events

A. ApplicationListener
B. ContextListener
C. EventListener
D. None of the mentioned
Answer» B. ContextListener
5.

Which interface defines methods for resolving text messages

A. MessageSource
B. ApplicationListener
C. ApplicationContextListener
D. TextEvent
Answer» B. ApplicationListener
6.

Which bean factory post processor externalizes part of the bean configurations into a properties file

A. PropertyPlaceholderConfigurer
B. PropertyPlaceholderRegister
C. PropertyGetPath
D. None of the mentioned
Answer» B. PropertyPlaceholderRegister
7.

PathCheckingBeanPostProcessor will not work properly in case of:-

A. XML Configuration
B. Java based Configuration
C. JSR Annotation
D. None of the mentioned
Answer» D. None of the mentioned
8.

It’s possible to replace the original bean instance with a brand-new instance in your bean post processor

A. True
B. False
Answer» B. False
9.

Which method of bean post processors is used to check path existence

A. getPath
B. setPath
C. value
D. auto-wiring
Answer» B. setPath
10.

Which Interface for bean Post Processor is used to distinguish between checked beans

A. StorageConfig
B. Marker
C. None of the mentioned
D. All of the mentioned
Answer» B. Marker
11.

In application context, BeanPost Processors are registered using addBeanPostProcessors method

A. True
B. False
Answer» C.
12.

Which method is used to register BeanPostProcessor?

A. addBeanPostProcessors
B. registerBeanPostProcessors
C. addBeanProcessors
D. none of the mentioned
Answer» B. registerBeanPostProcessors
13.

Which method is used to gracefully shutdown all the bean processes after closing the spring container?

A. shutdownHook
B. destroy method
C. none of the mentioned
D. all of the mentioned
Answer» B. destroy method
14.

Method used to process bean after initialization callback

A. scope
B. getBean
C. postProcessAfterInitialization()
D. it’s own constructor
Answer» D. it’s own constructor
15.

Method used to process bean before initialization callback

A. scope
B. postProcessAfterInitialization()
C. postProcessBeforeInitialization()
D. it’s own constructor
Answer» D. it’s own constructor
16.

PATHCHECKINGBEANPOSTPROCESSOR_WILL_NOT_WORK_PROPERLY_IN_CASE_OF:-?$

A. XML Configuration
B. Java based Configuration
C. JSR Annotation
D. None of the mentioned
Answer» D. None of the mentioned
17.

Which interface defines methods for resolving text messages$

A. MessageSource
B. ApplicationListener
C. ApplicationContextListener
D. TextEvent
Answer» B. ApplicationListener
18.

Which_bean_factory_post_processor_externalizes_part_of_the_bean_configurations_into_a_properties_file$

A. PropertyPlaceholderConfigurer
B. PropertyPlaceholderRegister
C. PropertyGetPath
D. None of the mentioned
Answer» B. PropertyPlaceholderRegister
19.

Which_interface_is_used_to_listen_to_certain_events

A. ApplicationListener
B. ContextListener
C. EventListener
D. None of the mentioned
Answer» B. ContextListener
20.

It’s possible to replace the original bean instance with a brand-new instance in your bean post processo?#

A. True
B. False
Answer» B. False