Spring/Spring Mcq Set 2 Sample Test,Sample questions

Question:
 Alternative annotative way to specify precedence of aspects?

1.@Order

2.@Aspect

3.@PointCut

4.none of the mentioned


Question:
 Expressions which returns Parameters of pointcuts?

1. target

2.args

3.none of the mentioned

4.all of the mentioned


Question:
 How to introduce counter field to original bean class?

1.Using Spring AOP

2. Implementing interface

3.AspectJ Pointcut

4. None of the mentioned


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

1.True

2.False

3.error

4.None of these


Question:
 Introduction advice helps in implementing multiple inheritance

1.True

2.False

3.error

4.None of these


Question:
 Pointcuts can be composed using:-

1.org.springframework.aop.support.Pointcuts class

2.composablePointcut class

3.all of the mentioned

4.none of the mentioned


Question:
 Tag used to declare aspects

1.aop:config

2.aop:auto-proxy

3.aop:autowire

4.None of the mentioned


Question:
 Which interface is used to listen to certain events

1. ApplicationListener

2.ContextListener

3.EventListener

4.none of the mentioned


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

1.Future.isDone()

2.Future.isCancelled()

3. None of the mentioned

4.all of the mentioned


Question:
Annotation used to declare an introduction

1.Before

2. After

3.@DeclareParents

4.none of the mentioned


Question:
Annotation used to refer poincuts?

1.@Pointcut

2.@PointcutExecution

3.@PointcutBefore

4.none of the mentioned


Question:
Are logical operators valid in pointcut expressions?

1.Yes

2.No

3.error

4.none of the mentioned


Question:
Attribute used to specify implementation class

1. no such attribute

2.defaultImpl

3. defaultInterface

4.defaultImplement


Question:
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

1. True

2.False

3.error

4.None of these


Question:
How does an Introduction advice do this in Spring?

1.dynamic proxy

2. web proxy

3.implements org.springframework.net.bundle interface

4.none of the mentioned


Question:
How to keep track of the usage of your beans

1.Calling Count

2. Last modified date

3.New Interface to your object

4. All of the mentioned


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

1. Yes

2.No

3.If every target class is in same package

4.Depends where target class is located


Question:
Language used to set various kinds of join points

1.AspectJ pointcut language

2. Java pointcut language

3.XML pointcut language

4. None of the mentioned


Question:
Method provided by ExectuorService which returns a Future < T >

1. submit

2.publish

3. addService

4.registerService


Question:
Method that converts string into a property value

1. getAsText

2. setAsText

3.regText

4.none of the mentioned


Question:
Method which checks if all target classes are matched

1.matches()

2.pair()

3.matchTargetClass()

4.none of the mentioned


Question:
Method which converts property into a string value

1.getAsText

2. setAsText

3.regText

4.none of the mentioned


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

1.getHighestPriority

2.getOrder

3.getHighOrder

4. getPriority


Question:
Pointcut used to parse an AspectJ pointcut expression string

1.org.springframework.aop.aspectj.AspectJExpressionPointcut

2.org.springframework.aop.aspectj.AspectJExpressionPointcutString

3. org.springframework.aop.aspectj.AspectJExpressionString

4.org.springframework.aop.aspectj.AspectJPointcuttoString


Question:
Spring supports operations on pointcuts:-

1. notably

2.union

3.intersection

4.all of the mentioned


Question:
Tag used to enable AspectJ annotation?

1.Introduction

2.aop:aspectj-autowire

3.aop:aspectj-autoproxy

4.AfterSpecial


Question:
Tag which defined Spring AOP configurations

1. aop:config

2.aop:configregister

3. aop:configbeans

4.none of the mentioned


Question:
The property value is retrieved by:-

1.getValue method

2.setValue method

3.none of the mentioned

4. All of the mentioned


Question:
What are the ways to create custom Property Editors?

1. implement PropertyEditor interface

2. extend PropertyEditorSupport Class

3.none of the mentioned

4. All of the mentioned


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

1. Runtime Error

2.IllegalArgumentException

3.BeanCreation Exception

4.none of the mentioned


Question:
Which advice combines all advices into one?

1.@Before

2.@After

3. @AfterThrowing

4.none of the mentioned


Question:
Which advice is executed once a joint point finishes?

1.@Before

2.@After

3.@AfterReturning

4. @AfterThrowing


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

1. @Before

2.@After

3. @AfterReturning

4. @AfterThrowing


Question:
Which event is provoked when web request comes into action

1. ContextClosedEvent

2. ContextStoppedEvent

3.SessionEvent

4.RequestHandledEvent


Question:
Which instantiation model is supported by AspectJ?

1.perthis

2. pertarget

3.none of the mentioned

4.all of the mentioned


Question:
Which interface is implemented to specify precedence of aspects?

1. Ordered

2.ApplicationAspect

3.AspectPointcut

4.none of the mentioned


Question:
Which interface is used to create your own property editors?

1.CustomEditorConfigurer

2.RegisterCustomEditor

3.PropertyEditorConfigurer

4.none of the mentioned


Question:
Which method is used to publish your own custom event

1. contextPublish

2. publishEvent

3.applicationEventPublish

4.addEvent


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

1.java.util.Timer

2. java.util.Date

3. java.util.HashMap

4.none of the mentioned


Question:
Which of the following is a well known recognized event

1.ContextCloasedEvemt

2.ContextRefreshedEvent

3. RequestHandledEvent

4. All of the mentioned


Question:
Which of the following is advice supported by Aspect Annotation?

1.@Before

2.@After

3. @AfterReturning

4.all of the mentioned


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

1. property Editor

2. property setter

3. property getter

4.none of the mentioned


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

1. bean(*Calculator)

2.bean(Calculator)

3.bean(com.appress.spring.Calculator)

4. None of the mentioned


Question:
Which of the following property editors are registered by Spring?

1. CustomNumberEditor

2.FileEditor

3.CustomDateEditor

4.CustomNetEditor


Question:
Which package is used for periodic work

1. java.lang.Thread

2. java.util.TimerTask

3. java.util.Timer

4. java.util.concurrent


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

1. java.net.*

2. java.io.*

3.java.net.URL

4. None of the mentioned


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

1. Introduction

2.Before

3. After

4.AfterSpecial


Question:
Which subinterface provides functionality for managing Threads and their events

1.ExecutorService

2.ThreadService

3.All of the mentioned

4.none of the mentioned


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

1.aop:before

2.aop:after

3.aop:afterthrow

4.none of the mentioned


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

1.aop:aspectj-autowire

2.aop:aspectj-name

3. aop:aspectj-autoproxy

4.none of the mentioned


More MCQS

  1. Spring Mcq Set 1
  2. Spring Mcq Set 2
  3. Spring Mcq Set 3
  4. Spring Mcq Set 4
  5. Spring Mcq Set 5
  6. Spring Mcq Set 6
  7. Spring Mcq Set 7
  8. Spring Mcq Set 8
  9. Spring Mcq Set 9
  10. Spring Mcq Set 10
  11. Spring Mcq Set 11
  12. Spring Mcq Set 12
  13. Spring Mcq Set 13
  14. Spring Mcq Set 14
  15. Spring Mcq Set 15
  16. Spring Mcq Set 16
  17. Spring Mcq Set 17
  18. Spring Mcq Set 18
  19. Spring Mcq Set 19
  20. Spring Mcq Questions
Search
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!