Spring MCQ

Spring MCQ

  • Admin
  • 21st May, 2021

Spring MCQ Quiz

Following are mostly asked Spring MCQ test that are designed for professionals like you to crack you interviews. You can take this Spring online test before appearing to you real interview. This Spring quiz there are around 30+ multiple choice questions on Spring with four options.

1) What is spring?

  • A. Proprietary framework.
  • B. Open source development framework for enterprise Java
  • C. Spring is a development framework for .Net applications.
  • D. Spring is a development framework for PHP based applications.

2) Which are the IoC containers in Spring?

  • A. BeanFactory, BeanContext, IocContextFactory
  • B. BeanFactory, ApplicationContext
  • C. BeanFactory, ApplicationContext, BeanContext
  • D. BeanFactory, ApplicationContext, IocContextFactory

3) Which are the different modes of autowiring?

  • A. byName, byContent, setter, autodetect
  • B. byName, byContent, constructor, autodetect
  • C. no, byName, byType, constructor, autodetect
  • D. no, byName, byType, constructor, autocorrect

4) What are the types of advice?

  • A. When, after, after-returning, around
  • B. Then, after, after-returning, after-throwing, around
  • C. Before, after, after-returning, after-throwing, around
  • D. Where, after, after-returning, after-throwing, around

5) Which of the following is part of Data Access layer in Spring framework?

  • A. JMS
  • B. Beans
  • C. Aspects
  • D. Context
Download Free : Spring MCQ PDF

6) Which class acts as IoC Container?

  • A. ApplicationContext
  • B. ServletContext
  • C. DispatcherServlet
  • D. None of the Above

7) If a bean is scoped to HTTP session, scope is

  • A. Request
  • B. Prototype
  • C. Session
  • D. Global-session

8) Can we inject value and ref both together in a bean?

  • A. True
  • B. False

9) Sessionfactory can manage contextual sessions for you and allows you to retrieve them by the

  • A. getCurrent() method
  • B. getSession() method
  • C. getCurrentSession() method
  • D. None of the Above

10) DAO methods must be made transactional.

  • A. True
  • B. False

11) Spring provides to simplify your DAO implementation by managing entitymanagers and transactions for you

  • A. JpaTemplate
  • B. SpringTemplate
  • C. HibernateTemplate
  • D. None of the Above

12) Annotation used for entity manager injection in EJB components.

  • A. @Persistence
  • B. @PersistenceCon
  • C. @PersistenceContext
  • D. None of the Above

13) To access a database running on the Derby server, you have to add -

  • A. Derby client library
  • B. Tomcat client library
  • C. Both A & B
  • D. None of the Above

14) Spring’s core transaction management abstraction is based on the interface -

  • A. PlatformManager
  • B. TransactionManager
  • C. PlatformTransaction
  • D. PlatformTransactionManager

15) Spring has several built-in implementations of PlatformTransactionManager interface for use with different transaction management APIs.

  • A. True
  • B. False

16) Method to start a new transaction with that definition

  • A. commit()
  • B. rollback()
  • C. getTransaction()
  • D. None of the Above

17) Spring (since version 2.0) offers a transaction advice that can be easily configured via the

  • A. tx:advice
  • B. rx:advice
  • C. bx:advice
  • D. None of the Above

18) The current method must start a new transaction and run within its own transaction

  • A. Required

19) The exceptions that cause a transaction to roll back or not can be specified by attribute

  • A. commit
  • B. serialize
  • C. rollback
  • D. None of the Above

20) Spring remoting facilities can significantly simplify the RMI usage on both the server and client sides.

  • A. True
  • B. False

21) The Spring support classes facilitate building session beans -

  • A. stateful session beans (SFSBs)
  • B. message-driven beans (MDBs)
  • C. stateless session beans (SLSBs)
  • D. All are Correct

22) Annotation which decorates the PostageServiceBean

  • A. @Wire
  • B. @Autowire
  • C. @Mention
  • D. @Interceptors

23) A remote stateless session bean requires annotations

  • A. @Stateless
  • B. @Remote
  • C. Both A & B
  • D. None of the Above

24) Spring framework itself also offers a remoting technology called HTTP Invoker.

  • A. True
  • B. False

25) Spring-WS provides various abstract endpoint classes for you to process the request.

  • A. org.springframework.*
  • B. org.springframework.ws.server
  • C. org.springframework.ws.server.endpoint
  • D. None of the Above

26) Spring-WS supports annotating an arbitrary class as a service endpoint by

  • A. @End
  • B. @Point
  • C. Both A & B
  • D. None of the Above

27) Spring supports JMX by allowing you to export any beans in its IoC container as model MBeans.

  • A. True
  • B. False

28) Spring allows you to create a JMX connector server through

  • A. ConnectorServer
  • B. ConnectorServerFactory
  • C. ConnectorServerFactoryBean
  • D. None of the Above

29) Spring 3.0 debuts new support for configuring

  • A. TaskExecutors
  • B. TaskSchedulers
  • C. Both A & B
  • D. None of the Above

30) Spring provides an implementation of SimpleMessageConvertor to handle the translation of a JMS message received.

  • A. True
  • B. False

31) Spring Dependency Injection is useful because it makes your code

  • A. Simple
  • B. Easier to test
  • C. Easier to understand
  • D. All are Correct

32) Which spring module provides the capability of DI or IOC?

  • A. AOP
  • B. Spring web
  • C. Core container
  • D. Data access

33) Which attribute is used to specify classname of the bean?

  • A. name
  • B. id
  • C. class
  • D. constructor-args

34) What are the ways to create custom Property Editors?

  • A. implement PropertyEditor interface
  • B. extend PropertyEditorSupport Class
  • C. Both A & B

35) Which attribute is used to set the scope of the bean?

  • A. setScope
  • B. scope
  • C. getScope
  • D. None of the Above

36) Which tag is also allowed by static field?

  • A. set
  • B. list
  • C. util:constant
  • D. constructor-args

37) Element used to specify access attributes for bean’s methods.

  • A. security:protect
  • B. security:intercept
  • C. security:intercept-security
  • D. None of the Above

38) To enable Spring security for web flows.

  • A. FlowSecurity
  • B. SecurityFlowListener
  • C. SecurityFlowExecution
  • D. SecurityFlowExecutionListener

39) Which attribute is used to access security element od web flow.

  • A. attribute
  • B. attributes
  • C. attributes-security
  • D. None of the Above

40) To access JSON in a Spring application, library used i

  • B. JSON-lib
  • C. SpringJSON-lib
  • D. None of the Above

41) Spring supports a series of mechanisms to generate a REST service’s payload

  • A. True
  • B. False

Leave A Comment :

Valid name is required.

Valid name is required.

Valid email id is required.

Related MCQ/Quiz

Python MCQ
Android MCQ