Top 50+ Solved Spring MCQ Questions Answer

From 1 to 10 of 10

Q. What is the basic concept of Spring?

a. Factory pattern

b. Singleton pattern

c. Dependency injection or Inversion of control

d. Abstract factory pattern

  • c. Dependency injection or Inversion of control

Q. Which spring module provides the capability of DI or IOC?

a. Spring web

b. Core container

c. AOP

d. Data access

  • b. Core container

Q. What are beans in the concept of Spring or what are spring beans?

a. Controller classes

b. Service classes

c. Repository

d. Any class that is managed by the container.

  • d. Any class that is managed by the container.

Q. How does spring achieve DI or IOC?

a. Service locator pattern

b. Factory pattern

c. Abstract factory pattern

d. Singleton pattern

  • a. Service locator pattern

Q. Which interface in spring is responsible for Instantiating and managing the so calledSpring beans?

a. Bean Factory

b. ApplicationContext

c. BeanDefenition

d. BeanDefenition

  • b. ApplicationContext

Q. Beans can be created by which of the following properties?

a. Scope

b. Property

c. Class

d. It’s own constructor

  • d. It’s own constructor

Q. Which attribute is used to specify class name of the bean?

a. name

b. id

c. class

d. constructor-args

  • c. class

Q. Which of the following method can be used to used to instantiate a method?

a. static factory method

b. default-init method

c. destroy method

d. lazy-init method

  • a. static factory method

Q. Which attribute is used to specify static factory-method?

a. factory-method

b. default-init method

c. destroy method

d. lazy-init method

  • a. factory-method

Q. Purpose of Static Factory Method?

a. Static method to create an object

b. Initialize bean

c. All of the mentioned

d. None of the mentioned

  • a. Static method to create an object
  • 1 (current)
Subscribe Now

Get All Updates & News