Explore topic-wise MCQs in Spring.

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

1.

Pointcut used to parse an AspectJ pointcut expression string

A. org.springframework.aop.aspectj.AspectJExpressionPointcut
B. org.springframework.aop.aspectj.AspectJExpressionPointcutString
C. org.springframework.aop.aspectj.AspectJExpressionString
D. org.springframework.aop.aspectj.AspectJPointcuttoString
Answer» B. org.springframework.aop.aspectj.AspectJExpressionPointcutString
2.

Pointcuts can be composed using:-

A. org.springframework.aop.support.Pointcuts class
B. composablePointcut class
C. all of the mentioned
D. none of the mentioned
Answer» D. none of the mentioned
3.

Spring supports operations on pointcuts:-

A. notably
B. union
C. intersection
D. all of the mentioned
Answer» E.
4.

Method which checks if all target classes are matched

A. matches()
B. pair()
C. matchTargetClass()
D. none of the mentioned
Answer» B. pair()
5.

Are logical operators valid in pointcut expressions?

A. Yes
B. No
Answer» B. No
6.

Expressions which returns Parameters of pointcuts?

A. target
B. args
C. none of the mentioned
D. all of the mentioned
Answer» E.
7.

Bean name patterns are supported by all configurations(XML,Java,AspectJ)

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

Which of the following pattern is used to match bean name?

A. bean(*Calculator)
B. bean(Calculator)
C. bean(com.appress.spring.Calculator)
D. None of the mentioned
Answer» B. bean(Calculator)
9.

The annotations must be added to the implementation class but not the interface

A. True
B. False
Answer» B. False
10.

Is the following pointcut expression correct?execution(* ArithmeticCalculator.*(..))

A. Yes
B. No
C. If every target class is in same package
D. Depends where target class is located
Answer» D. Depends where target class is located
11.

Spring AOP only supports method execution join points for the beans in its IoC container

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

Language used to set various kinds of join points

A. AspectJ pointcut language
B. Java pointcut language
C. XML pointcut language
D. None of the mentioned
Answer» B. Java pointcut language
13.

what will be the output of the code snippet?

A. Runtime Error
B. IllegalArgument Exception
C. BeanCreation Exception
D. None of the mentionedView Answer
Answer» D. None of the mentionedView Answer
14.

Annotation used to refer poincuts?

A. @Pointcut
B. @PointcutExecution
C. @PointcutBefore
D. None of the mentioned
Answer» B. @PointcutExecution
15.

PointCut definitions can’t be reused again

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

WHICH_OF_THE_FOLLOWING_PATTERN_IS_USED_TO_MATCH_BEAN_NAME??$

A. bean(*Calculator)
B. bean(Calculator)
C. bean(com.appress.spring.Calculator)
D. None of the mentioned
Answer» C. bean(com.appress.spring.Calculator)
17.

Expressions which returns Parameters of pointcuts?$

A. target
B. args
C. none of the mentioned
D. all of the mentioned
Answer» B. args
18.

Are_logical_operators_valid_in_pointcut_expressions?

A. Yes
B. No
Answer» B. No
19.

The annotations must be added to the implementation class but not the interfac?

A. True
B. False
Answer» B. False
20.

Is the following pointcut expression correct?

A. )
B. Yes
C. No
D. If every target class is in same package
Answer» B. Yes
21.

Runtime Error

A. IllegalArgument Exception
B. BeanCreation Exception
C. None of the mentioned
Answer» B. BeanCreation Exception
22.

PointCut definitions can’t be reused again

A. True
B. False
Answer» C.