Free CoreSpringV3.2 Exam Braindumps (page: 2)

Page 1 of 25

Select which statement(s) is/are true with respect to programming to interfaces with Spring

  1. The use of interfaces allows for reduced coupling between collaborating objects
  2. Spring requires all beans to implement interfaces
  3. Spring requires that parameters in constructors and setters are defined using interface types
  4. Spring requires all beans to have an empty constructor (either default or declared)

Answer(s): A



Consider the following class:

public class LegacySingleton {
private LegacySingleton(){}
public static LegacySingleton getAServiceInstance() {
return new LegacySingleton();
}
}

How can a bean of type LegacySingleton be created (using XML configuration)? (select one)

  1. It is not possible, the constructor must be public
  2. Use the factory-method attribute on the <bean> tag
  3. Use the init-method attribute on the <bean> tag
  4. Use autowiring

Answer(s): B



Which of the following scenarios requires you to instantiate an ApplicationContext using the ‘new’ keyword? (Select one)

  1. Running your Spring application inside a JUnit test (using SpringJUnit4ClassRunner)
  2. Bootstrapping your Spring application within a Java main() method
  3. Deploying your Spring application in an application server, packaged in a WAR file
  4. Both a and b

Answer(s): B



Select which statement is true with respect to constructor injection with Spring (select one)

  1. Multiple parameters can be dependency injected into a constructor
  2. Using XML configuration, the constructor-arg element may be omitted if the constructor requires a single parameter
  3. One single bean cannot mix constructor injection with setter injection
  4. All of the above

Answer(s): A






Post your Comments and Discuss SpringSource CoreSpringV3.2 exam with other Community members:

CoreSpringV3.2 Discussions & Posts