ExamGecko
Home Home / VMware / 2V0-72.22

VMware 2V0-72.22 Practice Test - Questions Answers, Page 4

Question list
Search
Search

Which two statements are correct when @SpringBootApplication is annotated on a class? (Choose two.)

A.
It causes Spring Boot to enable auto-configuration by default.
A.
It causes Spring Boot to enable auto-configuration by default.
Answers
B.
Component scanning will start from the package of the class.
B.
Component scanning will start from the package of the class.
Answers
C.
All other annotations on the class will be ignored.
C.
All other annotations on the class will be ignored.
Answers
D.
Methods in the class annotated with @Bean will be ignored.
D.
Methods in the class annotated with @Bean will be ignored.
Answers
E.
A separate ApplicationContext will be created for each class annotated with @SpringBootApplication.
E.
A separate ApplicationContext will be created for each class annotated with @SpringBootApplication.
Answers
Suggested answer: A, E

Explanation:

Reference: https://www.journaldev.com/21556/springbootapplication-springapplication

Refer to the exhibit.

It is a Java code fragment from a Spring application. Which statement is true with regard to the above example? (Choose the best answer.)

A.
This syntax is invalid because the result of the getBean() method call should be cast to ClientService.
A.
This syntax is invalid because the result of the getBean() method call should be cast to ClientService.
Answers
B.
It will return a bean called ClientService regardless of its id or name.
B.
It will return a bean called ClientService regardless of its id or name.
Answers
C.
This syntax is invalid because the bean id must be specified as a method parameter.
C.
This syntax is invalid because the bean id must be specified as a method parameter.
Answers
D.
It will return a bean of the type ClientService regardless of its id or name.
D.
It will return a bean of the type ClientService regardless of its id or name.
Answers
Suggested answer: D

Which two statements about pointcut expressions are true? (Choose two.)

A.
A pointcut expression cannot specify the type of parameters.
A.
A pointcut expression cannot specify the type of parameters.
Answers
B.
A pointcut expression will throw an exception if no methods are matched.
B.
A pointcut expression will throw an exception if no methods are matched.
Answers
C.
A pointcut expression cannot have a wildcard for a method name.
C.
A pointcut expression cannot have a wildcard for a method name.
Answers
D.
A pointcut expression can include operators such as the following: && (and), || (or), ! (not).
D.
A pointcut expression can include operators such as the following: && (and), || (or), ! (not).
Answers
E.
A pointcut expression can be used to select join points which have been annotated with a specific annotation.
E.
A pointcut expression can be used to select join points which have been annotated with a specific annotation.
Answers
Suggested answer: D, E

Explanation:

Reference: https://www.baeldung.com/spring-aop-pointcut-tutorial

Which three types of objects can be returned form a JdbcTemplate query? (Choose three.)

A.
Generic MapS
A.
Generic MapS
Answers
B.
Simple types (int, long, String, etc)
B.
Simple types (int, long, String, etc)
Answers
C.
JSONObject
C.
JSONObject
Answers
D.
User defined types
D.
User defined types
Answers
E.
Properties
E.
Properties
Answers
F.
XMLObject
F.
XMLObject
Answers
Suggested answer: B, D, E

Which two use cases can be addressed by the method level security annotation @PreAuthorize?

(Choose two.)

A.
Allow access to a method based on user identity.
A.
Allow access to a method based on user identity.
Answers
B.
Allow access to a method based on the returned object.
B.
Allow access to a method based on the returned object.
Answers
C.
Allow access to a method based on HTTP method.
C.
Allow access to a method based on HTTP method.
Answers
D.
Allow access to a method based on request URL.
D.
Allow access to a method based on request URL.
Answers
E.
Allow access to a method based on roles.
E.
Allow access to a method based on roles.
Answers
Suggested answer: C, E

Explanation:

Reference: https://docs.spring.io/springsecurity/site/docs/5.2.11.RELEASE/reference/html/authorization.html

Which statement is true about the @PropertySource annotation? (Choose the best answer.)

A.
Used to designate the location of the application.properties file in a Spring Boot application.
A.
Used to designate the location of the application.properties file in a Spring Boot application.
Answers
B.
Used to easily look up and return a single property value from some external property file.
B.
Used to easily look up and return a single property value from some external property file.
Answers
C.
Used to designate the file directory of the application.properties file in a Spring Boot application.
C.
Used to designate the file directory of the application.properties file in a Spring Boot application.
Answers
D.
Used to add a set of name/value pairs to the Spring Environment from an external source.
D.
Used to add a set of name/value pairs to the Spring Environment from an external source.
Answers
Suggested answer: B

Which two options are valid optional attributes for Spring’s @Transactional annotation? (Choose two.)

A.
isolation
A.
isolation
Answers
B.
writeOnly
B.
writeOnly
Answers
C.
nestedTransaction
C.
nestedTransaction
Answers
D.
readWrite
D.
readWrite
Answers
E.
propagation
E.
propagation
Answers
Suggested answer: A, E

Explanation:

Reference: https://learningviacode.blogspot.com/2012/10/attributes-in-springs-declarative.html

Which two statements are true about Spring Boot and Spring Data JPA? (Choose two.)

A.
@EntityScan and spring.jpa.* properties can be used to customize Spring Data JPA.
A.
@EntityScan and spring.jpa.* properties can be used to customize Spring Data JPA.
Answers
B.
Any kind of Hibernate property can be passed to Spring Data JPA like spring.jpa.properties.xxx.
B.
Any kind of Hibernate property can be passed to Spring Data JPA like spring.jpa.properties.xxx.
Answers
C.
Spring Data JPA is the only implementation for relational databases.
C.
Spring Data JPA is the only implementation for relational databases.
Answers
D.
Scanning of JPA Entities can not be customized, the whole classpath is scanned.
D.
Scanning of JPA Entities can not be customized, the whole classpath is scanned.
Answers
E.
Embedded Databases (H2, HSQLDB, Derby) are not re-created during the startup.
E.
Embedded Databases (H2, HSQLDB, Derby) are not re-created during the startup.
Answers
Suggested answer: C, E

Explanation:

Reference: https://docs.spring.io/spring-boot/docs/1.5.14.RELEASE/reference/html/boot-featuressql.html

Refer to the exhibit.

Based on the default Spring behavior, choose the correct answer. (Choose the best answer.)

A.
One AccountRepository bean will be instantiated since the default scope is singleton.
A.
One AccountRepository bean will be instantiated since the default scope is singleton.
Answers
B.
Three AccountRepository beans will be instantiated as the accountRepository() method will be called three times.
B.
Three AccountRepository beans will be instantiated as the accountRepository() method will be called three times.
Answers
C.
Many AccountRepository beans will be instantiated, depending how often accountRepository(), transferService() and accountService() are called.
C.
Many AccountRepository beans will be instantiated, depending how often accountRepository(), transferService() and accountService() are called.
Answers
D.
Two AccountRepository beans will be instantiated as the accountRepository() method will be called two times.
D.
Two AccountRepository beans will be instantiated as the accountRepository() method will be called two times.
Answers
Suggested answer: C

Refer to the exhibit.

Which two statements are correct regarding the HelloAutoConfig auto-configuration class when it is specified in the META-INF/spring.factories file? (Choose two.)

A.
A HelloService bean will be created from the helloService() method even if the HelloService.class is not in the classpath.
A.
A HelloService bean will be created from the helloService() method even if the HelloService.class is not in the classpath.
Answers
B.
A HelloService bean will be created from the helloService() method only when there is no other HelloService bean in the ApplicationContext.
B.
A HelloService bean will be created from the helloService() method only when there is no other HelloService bean in the ApplicationContext.
Answers
C.
This auto-configuration class is used only when the HelloService.class is not on the classpath.
C.
This auto-configuration class is used only when the HelloService.class is not on the classpath.
Answers
D.
This auto-configuration class is used only when the HelloService.class is on the classpath.
D.
This auto-configuration class is used only when the HelloService.class is on the classpath.
Answers
E.
A HelloService bean will be created from the helloService() method and will replace existing a HelloService bean in the ApplicationContext.
E.
A HelloService bean will be created from the helloService() method and will replace existing a HelloService bean in the ApplicationContext.
Answers
Suggested answer: B, D
Total 60 questions
Go to page: of 6