
- 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
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Spring Mock Test
This section presents you various set of Mock Tests related to Spring Framework. You can download these sample mock tests at your local machine and solve offline at your convenience. Every mock test is supplied with a mock test key to let you verify the final score and grade yourself.

Spring Mock Test III
Q 1 - What is Introduction?
A - An introduction represents a point in your application where you can plug-in AOP aspect.
B - This is used to inject values in objects.
C - This is not invoked during program execution by Spring AOP framework.
D - An introduction allows you to add new methods or attributes to existing classes.
Answer : D
Explanation
An introduction allows you to add new methods or attributes to existing classes.
Q 2 - What is Target object?
A - A represents a object in your application where you can plug-in AOP aspect.
C - This is used to inject values in objects.
D - This is not invoked during program execution by Spring AOP framework.
Answer : B
Explanation
Target object is advised by one or more aspects. Target object will always be a proxy object, also referred to as the advised object.
Q 3 - What is Weaving?
A - Weaving is the process of injecting values in objects to create an advised object.
Answer : B
Explanation
Weaving is the process of linking aspects with other application types or objects to create an advised object.
Q 4 - What are the different points where weaving can be applied?
Answer : D
Explanation
Weaving can be applied at Compile time, load Time and Run time.
Q 5 - What are the types of advice?
A - then, after, after-returning, after-throwing, around
B - When, after, after-returning, around
Answer : D
Explanation
Before, after, after-returning, after-throwing, around are the five types of advice that spring supports.
Q 6 - How before advice works?
A - Run advice before a class loads.
B - Run advice before a method execution.
Answer : B
Explanation
before advice runs before a method execution.
Q 7 - How after-returning advice works?
A - Run advice after a class loads only if class loads successfully.
B - Run advice after a method execution only if method completes successfully.
C - Run advice after http response is returned only if http response is success.
D - Run advice after http request is processed with no exception.
Answer : B
Explanation
before advice runs after a method execution only if method completes successfully.
Q 8 - How after-throwing advice works?
A - Run advice after a method execution only if method exits by throwing an exception.
B - Run advice after a class loads only if class throws exception during load time.
C - Run advice after http response is returned with error status.
D - Run advice after http request is processed and an exception occurred.
Answer : A
Explanation
after-throwing advice runs after http request is processed and an exception occurred.
Q 9 - How around advice works?
A - Run advice before and after the advised method is invoked.
B - Run advice before and after a class is loaded.
Answer : A
Explanation
around advice runs before and after the advised method is invoked.
Q 10 - 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 11 - What are the types of the transaction management Spring supports?
A - Programmatic transaction management
Answer : C
Explanation
Spring supports both Programmatic and Declarative transaction management.
Q 12 - What is Spring MVC framework?
A - Spring MVC framework is Model-Value-Class architecture and used to bind model data with values.
C - Spring MVC framework is used for Transaction management for Web Applications.
D - Spring MVC framework is used for AOP for Web Applications.
Answer : B
Explanation
The Spring web MVC framework provides model-view-controller architecture and ready components that can be used to develop flexible and loosely coupled web applications.
Q 13 - What is @Controller annotation?
A - The @Controller annotation indicates that a particular class serves the role of a controller.
B - The @Controller annotation indicates how to control the transaction management.
C - The @Controller annotation indicates how to control the dependency injection.
D - The @Controller annotation indicates how to control the aspect programming.
Answer : A
Explanation
The @Controller annotation indicates that a particular class serves the role of a controller.
Q 14 - What are the ways to access Hibernate by using Spring?
A - Inversion of Control with a Hibernate Template and Callback.
B - Extending HibernateDAOSupport and Applying an AOP Interceptor node.
Answer : C
Explanation
Hibernate can be accessed by both ways either using Inversion of Control with a Hibernate Template and Callback or extending HibernateDAOSupport and applying an AOP Interceptor node.
Q 15 - Which ORM Spring supports ?
Answer : D
Explanation
Spring supports all the mentioned ORMs.
Q 16 - Which of the following database is not supported using jdbcTemplate?
Answer : C
Explanation
NoSql is not supported using jdbcTemplate.
Q 17 - How to get object of a service in spring framework?
Answer : B
Explanation
In spring, dependency injection is used to get any object.
Q 18 - Which of the following is part of Data Access layer in Spring framework?
Answer : C
Explanation
JMS is the part of Data Access layer in Spring framework.
Q 19 - How to use ref keyword in beans.
xml?B - Using constructor argument only.
Answer : C
Explanation
ref is used to reference already defined bean and it can be used using both setter method and constructor argument.
Answer : B
Explanation
AOP is not the part of spring core container.
Answer : B
Explanation
SpEL is a part of core container.
Q 22 - Which class acts as IoC Container?
Answer : C
Explanation
ApplicationContext class acts as IoC Container.
Q 23 - What stands true for spring framework?
Answer : A
Explanation
Spring framework is a light weight framework.
Q 24 - Expression Language/ SpEL was introduced in which version of spring framework.
Answer : C
Explanation
Expression Language/ SpEL was introduced in 3.0 version of spring framework.
Answer : A
Explanation
Struts can be integrated with spring.
Answer Sheet
Question Number | Answer Key |
---|---|
1 | D |
2 | B |
3 | B |
4 | D |
5 | D |
6 | B |
7 | B |
8 | A |
9 | A |
10 | C |
11 | C |
12 | B |
13 | A |
14 | C |
15 | D |
16 | C |
17 | B |
18 | C |
19 | C |
20 | B |
21 | B |
22 | C |
23 | A |
24 | C |
25 | A |