What are singleton beans and how can you create prototype beans?

The singleton property of <bean> tells the context whether or not a bean is to be defined as a singleton. 
This attribute in bean tag named \"singleton\" if specified true then bean becomes singleton and if set to false then the bean becomes a prototype bean. By default it is set to true.

So, all the beans in spring framework are by default singleton beans.
       <bean id=\"bar\" class=\"com.act.Foo\" singleton=\"false\"/>

Prototyped beans are useful when you want the container to give a unique instance of a bean each time it is asked for, but you still want to configure one or more properties  of that bean through Spring.
  <bean id=\"student\"  class=\"com.StudentImpl\"

A new instance of a prototype bean will be created each time getBean() is invoked with the bean\'s name.

More interview questions and answers
Compare Spring with Enterprise Java Beans?
What is BeanFactory in Spring framework?
Define the use of UML?
What do you mean by SOAP and how to utilize this with Web Components?
What are the advantages of Spring framework?
What are features of Spring ?
What are the various steps involved in a Spring beans life cycle?
What do you mean by bean wiring in Spring container?
How do add a bean in spring application?
What is XMLBeanFactory in Spring framework?
What is Spring configuration file?
Tell me about software elements that we must used to build a SOAP server?
How do you unload the GUI map?
What actually happens when you load GUI map?
What is the purpose of the temp GUI map file?
How do you select multiple objects during merging the files?
How do you edit the expected value of an object?
How do you modify the expected results of a GUI checkpoint?
How do you handle ActiveX and Visual basic objects?
How do you create ODBC query?
How do you record a data driven test?
How do you convert a database file to a text file?
How do you parameterize database check points?
How do you create parameterize SQL commands?
What check points you will use to read and check text on the GUI and explain its syntax?
How to get Text from object/window ?
How to get Text from screen area ?
Which TSL functions you will use for Searching text on the window
What are the steps of creating a data driven test?
How to use data driver wizard?
How do you clear a GUI map files?
When the optional properties are learned?
How do you handle object exceptions?
What is a compile module?
What is the difference between script and compile module?
How do you write messages to the report?
What is a command to invoke application?
What is the purpose of tl_step command?
Which TSL function you will use to compare two files?
What is the use of function generator?
What is the use of putting call and call_close statements in the test script?
What is the use of treturn and texit statements in the test script?
What does auto, static, public and extern variables means?
How do you declare constants?
How do you declare arrays?
How do you load and unload a compile module?
Why you use reload function?
Write and explain compile module?
How you used WinRunner in your project?
What are singleton beans and how can you create prototype beans?
Have you created test scripts and what is contained in the test scripts?
How does WinRunner evaluate test results?
Have you performed debugging of the scripts?
Have you integrated your automated scripts from TestDirector?
What is meant by the logical name of the object?
How do you view the contents of the GUI map?
How to compare value of textbox in WinRunner?
Define Winrunner with combo box?
WinRunner: How to Set GUI file\'s searchpath?
WinRunner: How to check the tab order?
WinRunner: Why \"Bitmap Check point\" is not working with Framework?
How to Plan automation testing to to impliment keyword driven methodology in testing automation using winrunner8.2?
How does winrunner invoke on remote machine?
WinRunner: How to connect to ORACLE Database without TNS?
Have to verify against excel spread sheet where report descriptions are stored . please guide \"how to proceed?
WinRunner: While invoking Win Runner, the error message displays
WinRunner: How to use data driven technology in GUI Check points for Objects ?
How to handle \'Timeout expired\' problem in WinRunner when dealingwith Complex SQL Queries??
WinRunner: How to generate user name uniquely?
Unable to print a newline character [n] in file, any solution?
How to define the variable in script that have stored in excel sheet using winrunner?
WinRunner: How to Change physical description?
Is there any function in winrunner which will clear the history of the browser?
WinRunner: How to read dynamic names of html_link
Is it possible to use winrunner for testing .aspx forms or dotnet forms?
Can WinRunner put the test results in a file?
WinRunner: What is the difference between virtual object and custom object?
How to create an Object of an Excel File in WinRunner?
How to use values returned by VB script in winrunner?
WinRunner: What tag is required to allow me to identify a html table?
WinRunner: How to work with file type using WinRunner functions?
WinRunner: Do Java Add-Ins required for Web based Application?
How to generate unique name?
WinRunner: How to access the last window brought up?
WinRunner: How to identifying dynamic objects in web applications ?
WinRunner: How to delete files from drive?
WinRunner: Could do we start automation before getting the build?
How to create a GUI map dynamically?
WinRunner script for Waitbusy?
Define : WinRunner script to get Min and Max?
Define : Type special chars in WinRuneer?
How to convert variable from ascii to string?
Define : The script for WinRunner Database Functions?
How to get time duration in millisecond in WinRunner?
Working with QTP and work on web application which is developed on .Net>
How to verify the animations(gif files) present in the applications using WinRunner?
WinRunner: Should I sign up for a course at a nearby educational institution?
How important is QTP in automated testing, does only with manaul testing (Test Director) is enough for testing. Or do we require automated tools in each and every projects. What are the different advantages of the QTP?
Tell me about the TestDirector?
What is a backward compatible design?