Loading

Quipoin Menu

Learn • Practice • Grow

spring / Pointcut Expressions
mcq
Direction: Choose the correct option

Q1.

What is a pointcut expression in Spring AOP?
A. An expression that selects one or more join points
B. A type of advice
C. A method signature
D. An aspect
Direction: Choose the correct option

Q2.

Which of the following pointcut designators does Spring AOP support?
A. execution()
B. within()
C. args()
D. All of the above
Direction: Choose the correct option

Q3.

What does the execution() pointcut designator do?
A. Matches method execution join points
B. Matches types
C. Matches annotations
D. Matches arguments
Direction: Choose the correct option

Q4.

What does the following expression match? execution(public * *(..))
A. All public methods
B. All methods
C. All public classes
D. All public constructors
Direction: Choose the correct option

Q5.

What does the within() designator match?
A. All join points within certain types
B. All methods with certain annotations
C. All methods with certain arguments
D. All methods with certain return types
Direction: Choose the correct option

Q6.

What does the @annotation() designator do?
A. Matches join points where the subject has the given annotation
B. Matches annotated classes
C. Matches annotated methods
D. Both A and B
Direction: Choose the correct option

Q7.

What does args() designator match based on?
A. Method arguments
B. Return type
C. Annotations
D. Class type
Direction: Choose the correct option

Q8.

How do you combine pointcut expressions?
A. Using &&, ||, and ! operators
B. Using AND, OR, NOT
C. Using &, |, ~
D. None
Direction: Choose the correct option

Q9.

What does the bean() pointcut designator do (Spring-specific)?
A. Matches methods within a Spring bean with a specific name
B. Matches any bean
C. Matches bean methods
D. None
Direction: Choose the correct option

Q10.

What is the purpose of a named pointcut?
A. To reuse a pointcut expression across multiple advices
B. To name an advice
C. To create a pointcut variable
D. None