πŸ§ͺ Spring MCQ Quiz Hub

Spring Mcq Set 2

Choose a topic to test your knowledge and improve your Spring skills

Which interface is used to listen to certain events





βœ… Correct Answer: 1

Which method is used to publish your own custom event





βœ… Correct Answer: 2

Which of the following is a well known recognized event





βœ… Correct Answer: 4

Which event is provoked when web request comes into action





βœ… Correct Answer: 4

Which of the following is used to convert property values to text Values?





βœ… Correct Answer: 1

Which property editor is used to specify a URL String for a property of the URL type?





βœ… Correct Answer: 3

Which interface is used to create your own property editors?





βœ… Correct Answer: 1

Which of the following property editors are registered by Spring?





βœ… Correct Answer: 2

What are the ways to create custom Property Editors?





βœ… Correct Answer: 4

Method which converts property into a string value





βœ… Correct Answer: 1

Method that converts string into a property value





βœ… Correct Answer: 2

The property value is retrieved by:-





βœ… Correct Answer: 4

For a property editor to be searched correctly, it must be located in the same package as the target class, and the name must be Editor’s name





βœ… Correct Answer: 2

Which package is used for periodic work





βœ… Correct Answer: 2

Which subinterface provides functionality for managing Threads and their events





βœ… Correct Answer: 1

Method provided by ExectuorService which returns a Future < T >





βœ… Correct Answer: 1

Which method provided by ExecutorService is used to check whether job is finished or cancelled





βœ… Correct Answer: 4

Which of the following class’s instance is used by TimerTaskExecutor for managing jobs





βœ… Correct Answer: 1

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





βœ… Correct Answer: 4

Which of the following is advice supported by Aspect Annotation?





βœ… Correct Answer: 4

Which advice is executed once a joint point finishes?





βœ… Correct Answer: 2

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





βœ… Correct Answer: 3

Which advice combines all advices into one?





βœ… Correct Answer: 4

Which interface is implemented to specify precedence of aspects?





βœ… Correct Answer: 1

Alternative annotative way to specify precedence of aspects?





βœ… Correct Answer: 1

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





βœ… Correct Answer: 2

What will be the output of the code snippet? import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.AfterThrowing; @Aspect public class AfterThrowingExample { @AfterThrowing( pointcut="com.xyz.myapp.SystemArchitecture.dataAccessOperation()", throwing="ex") public void doRecoveryActions(DataAccessException e) { throw new IllegalArgumentException(); // ... } }





βœ… Correct Answer: 3

Which instantiation model is supported by AspectJ?





βœ… Correct Answer: 4

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





βœ… Correct Answer: 1

Annotation used to refer poincuts?





βœ… Correct Answer: 1

Language used to set various kinds of join points





βœ… Correct Answer: 1

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





βœ… Correct Answer: 3

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





βœ… Correct Answer: 1

Expressions which returns Parameters of pointcuts?





βœ… Correct Answer: 4

Are logical operators valid in pointcut expressions?





βœ… Correct Answer: 1

Method which checks if all target classes are matched





βœ… Correct Answer: 1

Spring supports operations on pointcuts:-





βœ… Correct Answer: 4

Pointcuts can be composed using:-





βœ… Correct Answer: 3

Pointcut used to parse an AspectJ pointcut expression string





βœ… Correct Answer: 1

Which special type of advice is used to implement an interface?





βœ… Correct Answer: 1

Introduction advice helps in implementing multiple inheritance





βœ… Correct Answer: 1

In introduction advice you have to modify class to introduce new methods





βœ… Correct Answer: 2

How does an Introduction advice do this in Spring?





βœ… Correct Answer: 1

Annotation used to declare an introduction





βœ… Correct Answer: 3

Attribute used to specify implementation class





βœ… Correct Answer: 2

How to keep track of the usage of your beans





βœ… Correct Answer: 4

How to introduce counter field to original bean class?





βœ… Correct Answer: 1

Tag used to declare aspects





βœ… Correct Answer: 1

Tag used to enable AspectJ annotation?





βœ… Correct Answer: 3

Tag which defined Spring AOP configurations





βœ… Correct Answer: 1