Explore topic-wise MCQs in Spring.

This section includes 16 Mcqs, each offering curated multiple-choice questions to sharpen your Spring knowledge and support exam preparation. Choose a topic below to get started.

1.

Which tag in XML is used to declare @Before advice’s method?

A. aop:before
B. aop:after
C. aop:afterthrow
D. None of the mentioned
Answer» B. aop:after
2.

Which instantiation model is supported by AspectJ?

A. perthis
B. pertarget
C. none of the mentioned
D. all of the mentioned
Answer» E.
3.

what will be the output of the code snippet

A. Runtime Error
B. IllegalArgumentException
C. BeanCreation Exception
D. None of the mentionedView Answer
Answer» D. None of the mentionedView Answer
4.

Method which returns the highest priority of aspect’s join point?

A. getHighestPriority
B. getOrder
C. getHighOrder
D. getPriority
Answer» C. getHighOrder
5.

Alternative annotative way to specify precedence of aspects?

A. @Order
B. @Aspect
C. @PointCut
D. None of the mentioned
Answer» B. @Aspect
6.

Which interface is implemented to specify precedence of aspects?

A. Ordered
B. ApplicationAspect
C. AspectPointcut
D. None of the mentioned
Answer» B. ApplicationAspect
7.

An advice can access the current join point information by declaring an argument of type org.aspectj.lang.AdvicePoint in the advice method signature.

A. True
B. False
Answer» C.
8.

Which advice combines all advices into one?

A. @Before
B. @After
C. @AfterThrowing
D. None of the mentioned
Answer» E.
9.

Which advice is executed only when joint point returns or throws an exception?

A. @Before
B. @After
C. @AfterReturning
D. @AfterThrowing
Answer» D. @AfterThrowing
10.

Which advice is executed once a joint point finishes?

A. @Before
B. @After
C. @AfterReturning
D. @AfterThrowing
Answer» C. @AfterReturning
11.

An advice is an action which comes into play at pointcuts.

A. True
B. False
Answer» C.
12.

Which of the following is advice supported by Aspect Annotation?

A. @Before
B. @After
C. @AfterReturning
D. All of the mentioned
Answer» E.
13.

Which tag informs the spring container about the use of AspectJ annotation?

A. aop:aspectj-autowire
B. aop:aspectj-name
C. aop:aspectj-autoproxy
D. none of the mentioned
Answer» D. none of the mentioned
14.

METHOD_WHICH_RETURNS_THE_HIGHEST_PRIORITY_OF_ASPECT‚ÄÖ√Ñ√∂‚ÀÖ√Ë‚ÀÖ¬•S_JOIN_POINT??$#

A. getHighestPriority
B. getOrder
C. getHighOrder
D. getPriority
Answer» C. getHighOrder
15.

ALTERNATIVE_ANNOTATIVE_WAY_TO_SPECIFY_PRECEDENCE_OF_ASPECTS??$

A. @Order
B. @Aspect
C. @PointCut
D. None of the mentioned
Answer» B. @Aspect
16.

Which tag in XML is used to declare @Before advice’s method?$

A. aop:before
B. aop:after
C. aop:afterthrow
D. None of the mentioned
Answer» C. aop:afterthrow