Loading

Q1.

What does the Spring IoC container mainly do?
A. Creates objects only
B. Injects dependencies only
C. Manages object creation AND dependency injection
D. Runs SQL queries automatically

Q2.

Which of the following BEST describes Dependency Injection?
A. Creating objects manually
B. Passing dependencies from outside
C. Hardcoding dependencies
D. Using static methods to create objects

Q3.

Which DI method is most recommended in Spring?

A. Field Injection
B. Constructor Injection
C. Reflection Injection
D. XML Injection

Q4.

What happens if you use 'new' inside your Spring bean class?

A. It strengthens loose coupling
B. It breaks IoC
C. It increases performance
D. It creates a proxy object

Q5.

Which dependency injection type is best for optional dependencies?

A. Constructor Injection
B. Setter Injection
C. Field Injection
D. Runtime Injection