--:--









Quiz for Dependency Injection

Course: JAVA | Subject: Java | Topic: Java Enterprise Edition



Logo

Q1: What is Dependency Injection in Java EE?

Logo

Q2: Which annotation is used for field injection in Java EE?

Logo

Q3: Which package provides @Inject annotation?

Logo

Q4: What is the main advantage of Dependency Injection?

Logo

Q5: Which Java EE component supports injection using @EJB?

Logo

Q6: Which annotation is used to inject environment resources like DataSource?

Logo

Q7: What does CDI stand for in Java EE?

Logo

Q8: What is required for a class to be eligible for injection in CDI?

Logo

Q9: Which scope annotation is used to declare a bean for a single HTTP request?

Logo

Q10: Which annotation provides the default scope in CDI?

Logo

Q11: Which interface is used to manually perform dependency injection?

Logo

Q12: What does @Named annotation do in CDI?

Logo

Q13: What is the use of @Produces annotation in CDI?

Logo

Q14: Which scope should be used for application-wide beans?

Logo

Q15: Which method allows setting a bean post-construction?

Logo

Q16: Which file activates CDI in Java EE web apps?

Logo

Q17: Which annotation is used to inject persistence context?

Logo

Q18: Which scope provides a new bean instance for every injection point?

Logo

Q19: What is the effect of using @Alternative in CDI?

Logo

Q20: What is injected with @Inject EntityManager em;?

Are you ready to start test? Set your time limit