- Spring Core Basics
- Spring - Home
- Spring - Overview
- Spring - Architecture
- Spring - Environment Setup
- Spring - Hello World Example
- Spring - IoC Containers
- Spring - Bean Definition
- Spring - Bean Scopes
- Spring - Bean Life Cycle
- Spring - Bean Post Processors
- Spring - Bean Definition Inheritance
- Spring - Dependency Injection
- Spring - Injecting Inner Beans
- Spring - Injecting Collection
- Spring - Beans Auto-Wiring
- Annotation Based Configuration
- Spring - Java Based Configuration
- Spring - Event Handling in Spring
- Spring - Custom Events in Spring
- Spring - AOP with Spring Framework
- Spring - JDBC Framework
- Spring - Transaction Management
- Spring - Web MVC Framework
- Spring - Logging with Log4J
- Spring Questions and Answers
- Spring - Questions and Answers
- Spring Useful Resources
- Spring - Quick Guide
- Spring - Useful Resources
- Spring - Discussion
Spring Online Quiz
Following quiz provides Multiple Choice Questions (MCQs) related to Spring Framework. You will have to read all the given answers and click over the correct answer. If you are not sure about the answer then you can check the answer using Show Answer button. You can use Next Quiz button to check new set of questions in the quiz.
Q 1 - Which are the modules of Web layer?
A - WebSocket, Servlet, Web, Portlet
Answer : A
Explanation
WebSocket, Servlet, Web, Portlet are the modules of Web layer.
Q 2 - What is singleton scope?
A - This scopes the bean definition to a single instance per Spring IoC container.
B - This scopes the bean definition to a single instance per HTTP Request.
C - This scopes the bean definition to a single instance per HTTP Session.
D - This scopes the bean definition to a single instance per HTTP Application/ Global session.
Answer : A
Explanation
singleton scope instructs Spring IoC container to create a single instance per IoC container.
Q 3 - What is true about <props> collection configuration elements?
A - This helps in wiring a list of values, allowing duplicates.
B - This helps in wiring a list of values but without any duplicates.
Answer : A
Explanation
<props> tag is used to inject a collection of name-value pairs where name and value are both Strings.
Q 4 - How do you turn on annotation wiring?
A - Add <annotation-context:config /> to bean configuration.
B - Add <annotation-config /> to bean configuration.
C - Add <annotation-context-config /> to bean configuration.
Answer : D
Explanation
Add <context:annotation-config/> to bean configuration to turn on annotation wiring.
Q 5 - What is Advice?
A - This is the way to instruct object to behave in certain manner.
B - This is used to inject values in objects.
C - This is the actual action to be taken either before or after the method execution.
D - This is not invoked during program execution by Spring AOP framework.
Answer : C
Explanation
Advice is the actual action to be taken either before or after the method execution.
Q 6 - Which of the following aspect implementation spring supports?
A - XML Schema based aspect implementation
Answer : C
Explanation
Spring supports both XML Schema based and @AspectJ based aspect implementation.
Q 7 - Which of the following database is not supported using jdbcTemplate?
Answer : C
Explanation
NoSql is not supported using jdbcTemplate.
Answer : B
Explanation
SpEL is a part of core container.
Q 9 - If a bean is scoped to HTTP session, scope is
Answer : B
Explanation
If a bean is scoped to HTTP session, scope is session.
Q 10 - What BeanPostProcessor does?
A - It processes beans once a bean is initialized.
Answer : B
Explanation
BeanPostProcessor defines callback methods that you can implement to provide your own instantiation logic, dependency-resolution logic etc.
To Continue Learning Please Login
Login with Google