/10
12 votes, 3.8 avg
503
Created on

Spring Quiz - Feb Week 3,2020

Spring quiz helps us to increase our knowledge

1 / 10

which annotation indicates that a specific parameter, return value, or field can be?

2 / 10

Which annotation can be used to import additional configuration classes?

3 / 10

Which of the following syntax is true to call the init() method at the time of bean initialization?

4 / 10

Is it the correct way to declare the bean and assing a way to the constructor (assing value using the type)?

XML:

<bean id="exampleBean" class="examples.ExampleBean">    <constructor-arg type="java.lang.String" value="7500000"/>    <constructor-arg type="java.lang.String" 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;    }}

 

5 / 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);

6 / 10

Which of the following is correct way to declare a bean in spring XML based configuration?

7 / 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("");

8 / 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;    }}

 

9 / 10

The ApplicationContext is a complete superset of the __________.

10 / 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.?

Please fill the following details to show the result.

Your score is

The average score is 53%

0%

Please rate this quiz