Spring MCQ Questions with Answers
Categories: MCQS
Spring MCQ Questions with Answers
Q 1 - Which are the modules of center compartment?
- Beans, Center, Setting, SpEL
- Center, Setting, ORM, Web
- Center, Setting, Viewpoints, Test
- Bean, Center, Setting, Test
Answer: A
Q 2 - What is singleton scope?
- This degrees the bean definition to a solitary case for every Spring IoC holder.
- This degrees the bean definition to a solitary case for every HTTP Solicitation.
- This degrees the bean definition to a solitary occurrence for each HTTP Meeting.
- This extensions the bean definition to a solitary case for each HTTP Application/Worldwide meeting.
Answer: A
Q 3 - What is demand scope?
- This degrees a bean definition to a HTTP demand.
- This degrees the bean definition to Spring IoC compartment.
- This extensions the bean definition to HTTP Meeting.
- This extensions the bean definition HTTP Application/Worldwide meeting.
Answer: A
Q 4 - What is autodetect method of autowiring?
- Like byType, however type applies to constructor contentions. On the off chance that there isn't precisely one bean of the constructor contention type in the holder, a lethal mistake is raised.
- Autowiring by property name. Spring attempts to coordinate and wire its properties with the beans characterized by similar names in the design document.
- Spring first attempts to wire utilizing autowire by constructor, in the event that it doesn't work, Spring attempts to autowire by byType.
- Autowiring by way of property kind. Spring attempts to coordinate and wire a property in the event that its sort coordinates with precisely one of the beans name in setup record.
Answer C
Q 5 - What is ContextStartedEvent occasion?
- This occasion is distributed when the Servlet Setting is either introduced or revived.
- This occasion is distributed when the HTTP Solicitation is gotten.
- This occasion is distributed when the ApplicationContext is begun utilizing the beginning () strategy on the ConfigurableApplicationContext interface.
- This occasion is distributed when the HTTP Reaction is returned.
Answer: C
Q 6 - What is the default extent of the beans?
- Model
- Meeting
- Demand
- Singleton
Answer: Singleton
Q 7 - ClassPathXmlApplicationContext look .xml record in:
- Explicit area inside filesystem
- Anyplace in project way (counting container record)
- Anyplace in classpath (counting container document)
- In web_inf organizer
Answer: c
Q 8 - How bean life cycle can be controlled?
- Utilizing init() as it were
- Utilizing InitializingBean class as it were
- Utilizing DisposableBean class as it were
- Utilizing All of above
Answer: D
Q 9 - In the event that a bean is checked to HTTP demand, extension is
- Meeting
- Worldwide meeting
- Model
- Demand
Answer: D