/10
9 votes, 3.6 avg
410
Created on

Spring Quiz - Feb Week 3,2020

Spring quiz helps us to increase our knowledge

1 / 10

Which annotation can be used to import additional configuration classes?

2 / 10

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

3 / 10

The ApplicationContext is a complete superset of the __________.

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

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

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

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

 

8 / 10

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

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

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 54%

0%

Please rate this quiz