Spring Quiz - Feb Week 3,2020
Spring quiz helps us to increase our knowledge
1 / 10
Is it the correct way to declare the bean and assing a way to the constructor (assing value using the index)?
XML:
<bean id="exampleBean" class="examples.ExampleBean"> <constructor-arg index="0" value="7500000"/> <constructor-arg index="1" value="42"/></bean>
Class:
public class ExampleBean { // Number of years to calculate the Ultimate Answer private int years; // The Answer to Life, the Universe, and Everything private String ultimateAnswer; public ExampleBean(int years, String ultimateAnswer) { this.years = years; this.ultimateAnswer = ultimateAnswer; }}
2 / 10
In spring bean, if we want to assign a null value to bean then which of the following way is correct?
I.e : exampleBean.setEmail(null);
exampleBean.setEmail(null);
3 / 10
The ApplicationContext is a complete superset of the __________.
ApplicationContext
4 / 10
In spring bean, if we want to assign an empty string value to bean then which of the following way is correct?
I.e : exampleBean.setEmail("");
exampleBean.setEmail("");
5 / 10
Which of the following syntax is true to call the init() method at the time of bean initialization?
6 / 10
which annotation indicates that a specific parameter, return value, or field can be?
7 / 10
In this Spring XML based configurations, __________ attribute can explicitly force one or more beans to be initialized before the bean using this element is initialized.?
8 / 10
Which annotation can be used to import additional configuration classes?
9 / 10
Is it the correct way to declare the bean and assing a way to the constructor (assing value using the type)?
<bean id="exampleBean" class="examples.ExampleBean"> <constructor-arg type="java.lang.String" value="7500000"/> <constructor-arg type="java.lang.String" value="42"/></bean>
10 / 10
Which of the following is correct way to declare a bean in spring XML based configuration?
Please fill the following details to show the result.
Your score is
The average score is 52%
Restart quiz
Please rate this quiz