Prabhu Sunderaraman
Fullstack Engineer, Programmer, Writer, Trainer
prabhu.bits@gmail.com
,
GitHub
Youtube
LinkedIn
Home
Profile
Books
Reading List
Browsing:
/
Home
/
Quiz on Spring framework – Part I
Print
Email
Shortlink
Quiz on Spring framework – Part I
By
Prabhu Sunderaraman
on
July 18, 2018
in
Spring
Take this quiz on
Spring framework
and evaluate yourself
Question #1: What is the annotation equivalent of the setter-based injection in XML?
@Component
@Autowired
@Set
@Wired
@Autowired. @Autowired is used to inject beans to a property
Question #2: What’s the default scope of all the beans in a web application?
prototype
request
session
singleton
singleton. There's only one instance of all the beans by default.
Question #3: How do you access a property version=1.0 present in a properties file?
{version}
version
#{version}
${version}
${version}. ${...} is the expression used to access any property
Question #4: What annotation is used to defer the instantiation of beans?
@Lazy
@Lazy-init
@Init
none of the above. Cannot be done.
@Lazy. Marking @Lazy on a component defers instantiation of a bean
Question #5: How do you get the reference of a @Component on a class MyAppCode?
getBean("MyAppCode")
getBean("myAppCode")
getBean("myappcode")
getBean("myappCode")
getBean("myAppCode"). The convention is the class name with the starting letter in lowercase
Question #6: How do you wire a properties collection to a property?
Using @Resource
Using @Props
Using @Inject
No way, you can do that
Using @javax.annotation.Resource
Question #7: What is the central convenient class used for JDBC operations in Spring?
Template
JdbcTemplate
DBTemplate
DbOps
JdbcTemplate. Most of the services are available using some xyzTemplate class in Spring
Question #8: What’s the root unchecked Exception that’s thrown by the Database Template classes?
JdbcTemplateException
DataAccessException
HibernateTemplateException
JpaTemplateException
DataAccessException. This is the root RuntimeException class thrown by the DB Template classes.
Cool!!!
That's ok!!!
Share this on:
Mixx
Delicious
Digg
Facebook
Twitter
Spring
Spring Boot
Leave a Reply
Click here to cancel reply.
Comment
Name
*
Email
*
Website
×
=
24
← Previous
Next →
Youtube Channel
Categories
JavaScript
(48)
RequireJS
(5)
Go
(44)
Golang
(44)
Ext JS
(23)
Spring
(22)
Mobile
(21)
Scala
(20)
Play
(3)
Uncategorized
(19)
Video Sessions
(18)
GoG
(17)
Sencha Touch
(16)
jQuery
(14)
Languages
(13)
Java 8
(12)
React JS
(11)
Kotlin
(11)
HealthyCodeMagazine
(9)
Video
(9)
Objective-C
(8)
NoSQL
(8)
Android
(7)
MongoDB
(7)
GWT
(6)
Tools
(6)
HTML 5
(5)
Cloud
(5)
General
(5)
Micro services
(5)
Java
(5)
Books
(4)
AWS
(4)
Software Architecture
(4)
.NET
(3)
Elixir
(3)
Docker
(3)
Reactive
(3)
NodeJS
(2)
RoR
(2)
Backbone
(1)
AngularJS
(1)
Archives
2020
(49)
2019
(7)
2018
(34)
2017
(15)
2016
(7)
2015
(18)
2014
(31)
2013
(55)
2012
(100)
Search
Subscribe