What is the default scope?

Spring puts each bean instance in a scope. What is the default scope? (Choose the best answer.)A . prototypeB . singletonC . requestD . sessionView AnswerAnswer: B Explanation: Spring supports different scopes for bean instances, such as singleton, prototype, request, session, etc. The scope determines how many instances of a...

April 30, 2025 No Comments READ MORE +

Which two statements are true about REST? (Choose two.)

Which two statements are true about REST? (Choose two.)A . REST is a Protocol.B . REST is Stateful.C . REST is Reliable.D . REST is Interoperable.E . REST is Relative.View AnswerAnswer: AD Explanation: Reference: https://www.tutorialspoint.com/restful/restful_introduction.htm

April 21, 2025 No Comments READ MORE +

Which two statements are true regarding Spring and Spring Boot Testing? (Choose two.)

Which two statements are true regarding Spring and Spring Boot Testing? (Choose two.)A . EasyMock is supported out of the box.B . @SpringBootTest or @SpringJUnitConfig can be used for creating an ApplicationContext.C . Mockito spy is not supported in Spring Boot testing by default.D . The spring-test dependency provides annotations...

April 16, 2025 No Comments READ MORE +

Which two statements are true about @Controller annotated classes? (Choose two.)

Which two statements are true about @Controller annotated classes? (Choose two.)A . The @Controller annotated classes can only render views.B . The classes are eligible for handling requests in Spring MVC.C . The classes must be annotated together with @EnableMvcMappings to be discovered via component scanning.D . @Controller is interchangeable...

April 12, 2025 No Comments READ MORE +

Which three types can be used as @Controller method arguments? (Choose three.)

Which three types can be used as @Controller method arguments? (Choose three.) A. Locale B. Principal C. Language D. Session E. Request F. HttpSessionView AnswerAnswer: ABF Explanation: A. Locale This is true because the Locale argument can be used to resolve the current locale that the client is using, based...

April 8, 2025 No Comments READ MORE +

Which two options will inject the value of the daily.limit system property? (Choose two.)

Which two options will inject the value of the daily.limit system property? (Choose two.)A . @Value(“#{daily.limit}”)B . @Value(“$(systemProperties.daily.limit)”)C . @Value(“$(daily.limit)”)D . @Value(“#{systemProperties[‘daily.limit’]}”)E . @Value(“#{systemProperties.daily.limit}”)View AnswerAnswer: CD Explanation: The @Value annotation can be used to inject values from external sources into fields, constructor parameters, or method parameters. To inject a system...

April 3, 2025 No Comments READ MORE +

Which three statements are advantages of using Spring’s Dependency Injection? (Choose three.)

Which three statements are advantages of using Spring’s Dependency Injection? (Choose three.)A . Dependency injection can make code easier to trace because it couples behavior with construction.B . Dependency injection reduces the start-up time of an application.C . Dependencies between application components can be managed external to the components.D ....

March 29, 2025 No Comments READ MORE +

Which option is true about use of mocks in a Spring Boot web slice test? (Choose the best answer.)

Which option is true about use of mocks in a Spring Boot web slice test? (Choose the best answer.)A . Mocking a Spring Bean requires annotating it with @MockBean annotation.B . If a Spring Bean already exists in the web slice test spring context, it cannot be mocked.C . Mocks...

March 29, 2025 No Comments READ MORE +

Which two are required to use transactions in Spring? (Choose two.)

Which two are required to use transactions in Spring? (Choose two.)A . Add @EnableTransactionManagement to a Java configuration class.B . Annotate a class, an interface, or individual methods requiring a transaction with the @Transactional annotation.C . A class must be annotated with @Service and @Transaction.D . A class requiring a...

March 25, 2025 No Comments READ MORE +

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.)

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.)A . @Autowired public void setFoo (Foo foo) {…}B . @Autowired @Qualifier (“foo3”) Foo foo;C . @Autowired public...

March 20, 2025 No Comments READ MORE +