đź§Ş Spring MCQ Quiz Hub

Spring Mcq Set 2

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

1. Which interface is used to listen to certain events




2. Which method is used to publish your own custom event




3. Which of the following is a well known recognized event




4. Which event is provoked when web request comes into action




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




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




7. Which interface is used to create your own property editors?




8. Which of the following property editors are registered by Spring?




9. What are the ways to create custom Property Editors?




10. Method which converts property into a string value




11. Method that converts string into a property value




12. The property value is retrieved by:-




13. 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




14. Which package is used for periodic work




15. Which subinterface provides functionality for managing Threads and their events




16. Method provided by ExectuorService which returns a Future < T >




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




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




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




20. Which of the following is advice supported by Aspect Annotation?




21. Which advice is executed once a joint point finishes?




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




23. Which advice combines all advices into one?




24. Which interface is implemented to specify precedence of aspects?




25. Alternative annotative way to specify precedence of aspects?




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




27. 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(); // ... } }




28. Which instantiation model is supported by AspectJ?




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




30. Annotation used to refer poincuts?




31. Language used to set various kinds of join points




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




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




34. Expressions which returns Parameters of pointcuts?




35. Are logical operators valid in pointcut expressions?




36. Method which checks if all target classes are matched




37. Spring supports operations on pointcuts:-




38. Pointcuts can be composed using:-




39. Pointcut used to parse an AspectJ pointcut expression string




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




41. Introduction advice helps in implementing multiple inheritance




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




43. How does an Introduction advice do this in Spring?




44. Annotation used to declare an introduction




45. Attribute used to specify implementation class




46. How to keep track of the usage of your beans




47. How to introduce counter field to original bean class?




48. Tag used to declare aspects




49. Tag used to enable AspectJ annotation?




50. Tag which defined Spring AOP configurations