Free 2V0-72.22 Exam Braindumps (page: 4)

Page 3 of 16

Which two statements are true concerning constructor injection? (Choose two.)

  1. If there is only one constructor the @Autowired annotation is not required.
  2. Constructor injection only allows one value to be injected.
  3. Constructor injection is preferred over field injection to support unit testing.
  4. Construction injection can be used with multiple constructors without @Autowired annotation.
  5. Field injection is preferred over constructor injection from a unit testing standpoint.

Answer(s): C,E



Given an ApplicationContext containing three bean definitions of type Foo with bean ids foo1, foo2, and foo3, which three @Autowired scenarios are valid and will allow the ApplicationContext to initialize successfully? (Choose three.)

  1. @Autowired public void setFoo (Foo foo) {...}
  2. @Autowired @Qualifier ("foo3") Foo foo;
  3. @Autowired public void setFoo (@Qualifier ("foo1") Foo foo) {...}
  4. @Autowired private Foo foo;
  5. @Autowired private Foo foo2;
  6. @Autowired public void setFoo(Foo foo2) {...}

Answer(s): A,D,F



Which dependency enables an automatic restart of the application as code is changed during development of a Spring boot configuration on a web application? (Choose the best answer.)

  1. spring-boot-devtools
  2. spring-boot-initializr
  3. spring-boot-starter-devtools
  4. spring-boot-restart

Answer(s): A


Reference:

https://docs.spring.io/spring-boot/docs/current/reference/html/using.html



Spring puts each bean instance in a scope.
What is the default scope? (Choose the best answer.)

  1. prototype
  2. singleton
  3. request
  4. session

Answer(s): B


Reference:

https://stackoverflow.com/questions/17599216/spring-bean-scopes






Post your Comments and Discuss VMware 2V0-72.22 exam with other Community members:

2V0-72.22 Discussions & Posts