Sail E0 Webinar

MCQs

Total Questions : 10
Question 1. Which method is used to gracefully shutdown all the bean processes after closing the spring container?
  1.    shutdownHook
  2.    destory method
  3.    none of the mentioned
  4.    all of the mentioned
 Discuss Question
Answer: Option A. -> shutdownHook


ShutdownHook method gracefully shuts down each bean process before closing the container.


Question 2. What are the ways to create custom Property Editors?
  1.    implement PropertyEditor interface
  2.    extend PropertyEditorSupport Class
  3.    none of the mentioned
  4.    all of the mentioned
 Discuss Question
Answer: Option D. -> all of the mentioned


You can write custom property editors by implementing the java.beans.PropertyEditor interface or extending the convenient support class java.beans.PropertyEditorSupport.


Question 3. Which one is the default scope of the beans?
  1.    Prototype
  2.    Session
  3.    Request
  4.    Singleton
 Discuss Question
Answer: Option D. -> Singleton


This unique bean instance will be returned for all subsequent getBean() calls and bean references.


Question 4. Declaring bean form object properties can be done using:-
  1.    PropertyPathFactoryBean
  2.    util:constant
  3.    None of the mentioned
  4.    All of the mentioned
 Discuss Question
Answer: Option A. -> PropertyPathFactoryBean


To declare a bean from an object property or a property path, you can make use of either the built-in factory bean PropertyPathFactoryBean or the util:property-path tag in Spring 2.x.


Question 5. Which attribute is used to specify classname of the bean?
  1.    name
  2.    id
  3.    class
  4.    constructor-args
 Discuss Question
Answer: Option C. -> class


Class attribute is mandatory and denotes the class used to create bean.


Question 6. Which package is used for periodic work
  1.    java.lang.Thread
  2.    java.util.TimerTask
  3.    java.util.Timer
  4.    java.util.concurrent
 Discuss Question
Answer: Option B. -> java.util.TimerTask


Java 1.3 saw the introduction of java.util.TimerTask to support doing some sort of work periodically.


Question 7. Which attribute is used to set the scope of the bean?
  1.    setScope
  2.    scope
  3.    getScope
  4.    none of the mentioned
 Discuss Question
Answer: Option B. -> scope


Scope attribute defines the scope of a bean.


Question 8. Method used to process bean before initialization callback
  1.    scope
  2.    postProcessAfterInitialization()
  3.    postProcessBeforeInitialization()
  4.    it's own constructor
 Discuss Question
Answer: Option C. -> postProcessBeforeInitialization()


You can process every bean before initialization callback method by implementing the postProcessBeforeInitialization() and methods.


Question 9. Which tag is also allowed by static field?
  1.    util:constant
  2.    list
  3.    set
  4.    constructor-args
 Discuss Question
Answer: Option A. -> util:constant


Spring 2 and later allow you to declare a bean from a static field by using the util:constant tag.


Question 10. Which attribute is used to specify classname of the bean?
  1.    name
  2.    id
  3.    class
  4.    constructor-args
 Discuss Question
Answer: Option C. -> class


Class attribute is mandatory and denotes the class used to create bean.


Latest Videos

Latest Test Papers