250+ TOP MCQs on Property Editors and TaskExecutors in Spring and Answers

Java Spring Multiple Choice Questions & Answers (MCQs) on “Property Editors and TaskExecutors in Spring”.

1. Which of the following is used to convert property values to text Values?
a) property Editor
b) property setter
c) property getter
d) none of the mentioned
Answer: a
Clarification: A property editor is a feature of the JavaBeans API for converting property values to and from text values.

2. Which property editor is used to specify a URL String for a property of the URL type?
a) java.net.*
b) java.io.*
c) java.net.URL
d) none of the mentioned
Answer: c
Clarification: Spring will automatically convert the URL string into a URL object and inject it into your property.

3. Which interface is used to create your own property editors?
a) CustomEditorConfigurer
b) RegisterCustomEditor
c) PropertyEditorConfigurer
d) None of the mentioned
Answer: a
Clarification: The CustomEditorConfigurer is implemented as a bean factory post processor for you to register your custom property editors before any of the beans get instantiated.

4. Which of the following property editors are registered by Spring?
a) CustomNumberEditor
b) FileEditor
c) CustomDateEditor
d) CustomNetEditor
Answer: b
Clarification: ClassEditor, FileEditor, LocaleEditor, and URLEditor are pre registered by Spring, so you don’t need to register them again.

5. What are the ways to create custom Property Editors?
a) implement PropertyEditor interface
b) extend PropertyEditorSupport Class
c) none of the mentioned
d) all of the mentioned
Answer: d
Clarification: You can write custom property editors by implementing the java.beans.PropertyEditor interface or extending the convenient support class java.beans.PropertyEditorSupport.

6. Method which converts property into a string value
a) getAsText
b) setAsText
c) regText
d) None of the mentioned
Answer: a
Clarification: The getAsText() method converts a property into a string value.

7. Method that converts string into a property value
a) getAsText
b) setAsText
c) regText
d) None of the mentioned
Answer: b
Clarification: The setAsText() method converts a string back into a property.

8. The property value is retrieved by:-
a) getValue method
b) setValue method
c) none of the mentioned
d) all of the mentioned
Answer: d
Clarification: The property value is retrieved and set by calling the getValue() and setValue() methods.

9. 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
a) True
b) False
Answer: b
Clarification: The name must be target class name with Editor as its suffix.

10. Which package is used for periodic work
a) java.lang.Thread
b) java.util.TimerTask
c) java.util.Timer
d) java.util.concurrent
Answer: b
Clarification: Java 1.3 saw the introduction of java.util.TimerTask to support doing some sort of work periodically.

11. Which subinterface provides functionality for managing Threads and their events
a) ExecutorService
b) ThreadService
c) All of the mentioned
d) None of the mentioned
Answer: a
Clarification: ExecutorService, a subinterface, provides more functionality for managing threads and providing support for raising events to the threads, such as shutdown().

12. Method provided by ExectuorService which returns a Future < T >
a) submit
b) publish
c) addService
d) registerService
Answer: a
Clarification: ExecutorService, a subinterface, provides more functionality for managing threads and providing support for raising events to the threads, such as shutdown().

13. Which method provided by ExecutorService is used to check whether job is finished or cancelled
a) Future.isDone()
b) Future.isCancelled()
c) None of the mentioned
d) All of the mentioned
Answer: d
Clarification: You can call Future.isDone() or Future.isCancelled() to determine whether the job is finished or cancelled, respectively.

14. The Quartz integration and message driven POJO container doesn’t needs TaskExecutor Services
a) True
b) False
Answer: b
Clarification: The TaskExecutor interface is used quite a bit internally in the Spring framework.

15. Which of the following class’s instance is used by TimerTaskExecutor for managing jobs
a) java.util.Timer
b) java.util.Date
c) java.util.HashMap
d) none of the mentioned
Answer: a
Clarification: TimerTaskExecutor uses a java.util.Timer instance and manages jobs (java.util.concurrent.Callable or java.lang.Runnable instances) for you by running them on the Timer.

250+ TOP MCQs on Views Mapping and Handling and Answers

Java Spring Multiple Choice Questions & Answers (MCQs) on “Views Mapping and Handling”.

1. Interface for Dispatcher Servlet to auto detect view resolver beans.
a) localeResolver
b) tiles
c) ViewResolver
d) none of the mentioned
Answer: c
Clarification: Spring MVC comes with several ViewResolver implementations for you to resolve views using different strategies.

2. ViewResolver which maps each view name tol an application’s directory.
a) InternalViewResolver
b) InternalResourceViewResolver
c) InternalResolver
d) None of the mentioned
Answer: b
Clarification: The view resolver InternalResourceViewResolver maps each view name to an application’s directory by means of a prefix and a suffix declaration.

3. InternalResourceViewResolver resolves view names into view objects of type.
a) JstlView
b) Jst Library
c) View
d) None of the mentioned
Answer: a
Clarification: By default, InternalResourceViewResolver resolves view names into view objects of type JstlView if the JSTL library (i.e., jstl.jar) is present in the classpath.

4. By default, XmlViewResolver loads view beans from /WEB-INF/views.xml which is final.
a) True
b) False
Answer: b
Clarification: This location can be overridden through the location property.

5. View beans from a resource bundle is loaded by.
a) ResourceBundleViewResolver
b) ResourceBundleView
c) ResourceViewResolver
d) None of the mentioned
Answer: a
Clarification: ResourceBundleViewResolver loads view beans from a resource bundle in the classpath root.

6. Views that can’t be resolved by InternalResourceViewResolver.
a) redirect
b) redirect:prefix
c) redirect:suffix
d) all of the mentioned
Answer: a
Clarification: Now the resource bundle views.properties should only contain the views that can’t be resolved by InternalResourceViewResolver (e.g., the redirect views).

7. Properties used to determine the correct content and type for a certain web requests.
a) The URL extension provided in a request
b) The HTTP Accept header
c) All of the mentioned
d) None of the mentioned
Answer: c
Clarification: When a request is received for a web application, it contains a series of properties that allow the processing framework, in this case Spring MVC, to determine the correct content and type to return to the requesting party.

8. Inspection of header is done by which of the following.
a) InternalViewResolver
b) ContentNegotiatingViewResolver
c) ContentNegotiating
d) InternalResolver
Answer: b
Clarification: Inspecting HTTP Accept headers in a controller can be a messy process. So Spring MVC supports the inspection of headers through the ContentNegotiatingViewResolver.

9. ContentNegotiatingViewResolver resolver configuration sets up the resolver to have the highest priority among all resolvers.
a) True
b) False
Answer: a
Clarification: It’s necessary to make the content negotiating resolver work.

10. The ContentNegotiatingViewResolver resolver first determines the media type for a request based on which of the following criteria?
a) It checks a request path extension
b) If a request path has an extension but no match can be found in the default mediaTypes section of the ContentNegotiatingViewResolver bean
c) If no extension is present in a request path, the HTTP Accept header of the request is used
d) All of the mentioned
Answer: d
Clarification: It checks a request path extension (e.g., .html, .xml, or .pdf) against the default
media types (e.g., text/html) specified in the mediaTypes section of the
ContentNegotiatingViewResolver bean.
If a request path has an extension but no match can be found in the default
mediaTypes section of the ContentNegotiatingViewResolver bean, an attempt is
made to determine an extension’s media type using FileTypeMap belonging to Java
Activation Framework.
If no extension is present in a request path, the HTTP Accept header of the request
is used.

11. In a Spring MVC application, you can register one or more exception resolver beans in the web application context to resolve uncaught exceptions.
a) True
b) False
Answer: a
Clarification: These beans have to implement the HandlerExceptionResolver interface for DispatcherServlet to auto-detect them.

12. To configure the exception mappings in the web application context.
a) SimpleMappingExceptionResolver
b) ExceptionResolver
c) ExceptionViewResolver
d) None of the mentioned
Answer: a
Clarification: Spring MVC comes with the exception resolver SimpleMappingExceptionResolver for you to configure the exception mappings in the web application context.

13. Annotation which allows a controller’s field to be assigned using Spring Expression Language(SpEL)
a) @Value
b) @After
c) @Default
d) @None
Answer: a
Clarification: You can use the @Value annotation along with SpEL to query beans present in an application’s context and extract values to help you initialize controller fields.

14. SpEL statements are recognizable.
a) True
b) False
Answer: a
Clarification: They use a notation in the form “#{ SpEL statement }”.

15. Tag, used to define a location in which to place errors in case a form.
a) form
b) form:GET
c) form:POST
d) form:errors
Answer: d
Clarification: You can find the form:errors tag, used to define a location in which to place errors in case a form does not meet the rules set forth by a controller.

250+ TOP MCQs on Problems with Direct JDBC and Answers

Java Spring Multiple Choice Questions & Answers (MCQs) on “Problems with Direct JDBC”.

1. Spring supports most of the popular ORM (or data mapper) frameworks.
a) Hibernate
b) JDO
c) JPA
b) All of the mentioned
Answer: d
Clarification: Spring supports most of the popular ORM (or data mapper) frameworks, including Hibernate, JDO, iBATIS, and the Java Persistence API (JPA).

2. ORM which isn’t supported by Spring:-
a) Hibernate
b) JDO
c) TopLink
b) All of the mentioned
Answer: d
Clarification: Classic TopLink isn’t supported starting from Spring 3.0 (the JPA implementation still supported, of course).

3. An ORM framework persists your objects according to the mapping metadata you provide.
a) True
b) False
Answer: a
Clarification: XML- or annotation-based, such as the mappings between classes and tables, properties and columns, and so on.

4. Database Engine which uses low memory consumption and easy configuration.
a) SQL
b) MySQL
c) Apache Derby
d) None of the mentioned
Answer: c
Clarification: Derby is an open source relational database engine provided under the Apache License and implemented in pure Java.

5. Mode which Derby prefers to run in:-
a) embedded
b) client/server
c) all of the mentioned
d) none of the mentioned
Answer: c
Clarification: Derby can run in either the embedded mode or the client/server mode.

6. For testing purposes, the client/server mode is more appropriate.
a) True
b) False
Answer: a
Clarification: It allows you to inspect and edit data with any visual database tools that support JDBC—for example, the Eclipse Data Tools Platform (DTP).

7. To start the Derby server in the client/server mode.
a) startNetworkServer java file
b) startNetworkServer script
c) startNetwork script
d) all of the mentioned
Answer: b
Clarification: To start the Derby server in the client/server mode, just execute the startNetworkServer script for your platform (located in the bin directory of the Derby installation).

8. JDBC Properties for Connecting to the Application Database.
a) Driver Class
b) URL
c) Username
d) All of the mentioned
Answer: d
Clarification: JDBC Properties for Connecting to the Application Database
Property Value
Driver class org.apache.derby.jdbc.ClientDriver
URL jdbc:derby://localhost:1527/vehicle;create=true
Username app
Password app

9. The general purpose of the Data Access Object (DAO) pattern is to avoid these logic related problems by separating data access logic from business logic and presentation logic.
a) True
b) False
Answer: a
Clarification: This pattern recommends that data access logic be encapsulated in independent modules called data access objects.

10. To access the database with JDBC:-
a) DAO interface
b) DAO Class
c) DataAccess interface
d) None of the mentioned
Answer: a
Clarification: Because your DAO implementation has to connect to the database to execute SQL statements, you may establish database connections by specifying the driver class name, database URL, username, and password.

11. Standard interface defined by the JDBC specification that factories Connection instances.
a) javax.sql.DataAccess
b) javax.sql.DataSource
c) javax.sql.Data
d) javax.sql.DataSourceAccess
Answer: b
Clarification: The javax.sql.DataSource interface is a standard interface defined by the JDBC specification that factories Connection instances.

12. Data source implementations provided by different vendors and projects.
a) C3PO
b) Apache Commons DBCP
c) All of the mentioned
d) None of the mentioned
Answer: c
Clarification: C3PO and Apache Commons DBCP are popular open source options, and most applications servers will provide their own implementation.

13. Spring also provides several convenient but less powerful data source implementations.
a) DriverManagerDataSource
b) DriverManagerData
c) DriverManagerDataAccess
d) DriverManagerDataSourceAccess
Answer: a
Clarification: The simplest one is DriverManagerDataSource, which opens a new connection every time one is requested.

14. SingleConnectionDataSource (a DriverManagerDataSource subclass). As its name indicates, this maintains only a single connection.
a) True
b) False
Answer: a
Clarification: Another data source implementation provided by Spring is SingleConnectionDataSource (a DriverManagerDataSource subclass). As its name indicates, this maintains only a single connection that’s reused all the time and never closed.

15. Which DataSource is not stable in MultiThreaded Environment?
a) DriverManagerDataSource
b) SingleConnectionDataSource
c) All of the mentioned
d) None of the mentione
Answer: c
Clarification: As its name indicates, this maintains only a single connection that’s reused all the time and never closed. Obviously, it is not suitable in a multithreaded environment.

250+ TOP MCQs on Integration of Systems and Answers

Java Spring Multiple Choice Questions & Answers (MCQs) on “Integration of Systems”.

1. Integration of Spring which has each application produce files of shared data for others to consume.
a) File transfer
b) Shared Database
c) Remote Procedure Invocation
d) Messaging
Answer: a
Clarification: File transfer: Have each application produce files of shared data for others to consume and consume files that others have produced.

2. Integration of Spring which has the applications store the data they want to share in a common database.
a) File transfer
b) Shared Database
c) Remote Procedure Invocation
d) Messaging
Answer: b
Clarification: This usually takes the form of a database to which different applications have access.

3. Integration of Spring which has each application expose some of its procedures so that they can be invoked remotely and have applications invoke them to initiate behavior and exchange data.
a) File transfer
b) Shared Database
c) Remote Procedure Invocation
d) Messaging
Answer: c
Clarification: There is specific support for optimizing RPC (remote procedure calls such as SOAP, RMI, and HTTP Invoker) exchanges using Spring Integration.

4. Integration of Spring which has each application connect to a common messaging system and exchange data and invoke behavior using messages.
a) File transfer
b) Shared Database
c) Remote Procedure Invocation
d) Messaging
Answer: d
Clarification: This style, most enabled by JMS in the JEE world, also describes other asynchronous or multicast publish/subscribe architectures.

5. Using an ESB lets you hide the origin of the message from the code that’s handling it.
a) True
b) False
Answer: a
Clarification: You’ll use this solution as an easy way to see how a Spring Integration solution can be built.

6. As with a standard MDP, a configuration for the ConnectionFactory exists.
a) True
b) False
Answer: a
Clarification: There’s also a lot of other schem as required for using the configuration elements available in Spring Integration.

7. The configuration starts with the inboundHelloJMSMessageChannel channel, which tells Spring Integration what to name the point-to-point connection from the message queue to the:-
a) service-activator
b) service
c) all of the mentioned
d) none of the mentioned
Answer: a
Clarification: You typically define a new channel for every point-to-point connection.

8. An adapter is a component that knows how to speak to a specific type of subsystem and translate messages on that subsystem into something that can be used in the Spring Integration bus only.
a) True
b) False
Answer: a
Clarification: Adapters also do the same in reverse, taking messages on the Spring Integration bus and translating them into something a specific subsystem will understand.

9. A service-activator, however, only helps you invoke your application’s business logic on receipt of a message.
a) True
b) False
Answer: a
Clarification: What you do in the business logic, connecting to another system or not, is up to you.

10. The next component, a service-activator, listens for messages coming into that channel and invokes the bean referenced by the:-
a) ref
b) after
c) before
d) all of the mentioned
Answer: a
Clarification: The next component, a service-activator, listens for messages coming into that channel and invokes the bean referenced by the ref attribute, which in this case is the bean defined previously: inboundHelloWorldJMSPingServiceActivator.

11. Headers Found in Spring Integration Messages:-
a) ID
b) TIMESTAMP
c) CORRELATION_ID
d) All of the mentioned
Answer: d
Clarification: Constant ID This is a unique value assigned to the message by the Spring Integration engine.
TIMESTAMP Timestamp assigned to the message.
CORRELATION_ID This is optional. It is used by some components (such as aggregators) to group
messages together in some sort of processing pipeline.
REPLY_CHANNEL The String name of the channel to which the output of the current component
should be sent. This can be overridden.
ERROR_CHANNEL The String name of the channel to which the output of the current component
should be sent if an exception bubbles up into the runtime. This can be overridden.
EXPIRATION_DATE Used by some components as a threshold for processing after which a component
can wait no longer in processing.
SEQUENCE_NUMBER The order in which the message is to be sequenced; typically used with a sequencer.
SEQUENCE_SIZE
838
Description
The size of the sequence so that an aggregator can know when to stop waiting for
more messages and move forward. This is useful in implementing “join”
functionality.

12. Some header values are specific to the type of the source message payload.
a) True
b) False
Answer: a
Clarification: Some header values are specific to the type of the source message payload; for example, payloads sourced from a file on the file system are different from those coming in from a JMS queue, which is different from messages coming from an email system.

13. Component-specific headers are the constants defined for files on:-
a) org.springframework.integration.file.FileHeaders: FILENAME
b) org.springframework.integration.file.FileHeaders: PREFIX
c) all of the mentioned
d) none of the mentioned
Answer: c
Clarification: An example of component-specific headers are the constants defined for files on org.springframework.integration.file.FileHeaders: FILENAME and PREFIX.

14. Annotation to get access to header metadata:-
a) @Ref
b) @service
c) @Header
d) None of the mentioned
Answer: c
Clarification: Another way to get access to header metadata is to simply have it passed as parameters to your component’s method. You simply annotate the parameter with the @Header annotation, and Spring Integration will take care of the rest.

15. The code for the service-activator has changed to reflect the fact that you’re expecting a message containing a message of type:-
a) Message
b) Message
c) All of the mentioned
d) None of the mentioned
Answer: a
Clarification: The code for the service-activator has changed to reflect the fact that you’re expecting a message containing a message of type Message

250+ TOP MCQs on Java Send Email API and Answers

Java Spring Puzzles on “Java Send Email API”.

1. To send an email using your Java Application:-
a) JavaMail API
b) Java Activation Framework (JAF)
c) All of the mentioned
d) None of the mentioned

Answer: c
Clarification: You can download latest version of JavaMail (Version 1.2) from Java’s standard website. You can download latest version of JAF (Version 1.1.1) from Java’s standard website.

2. If you want to send an email to multiple recipients:-
a) void addRecipients(Message.RecipientType type, Address[] addresses)
b) void addRecipients(Message.RecipientType type)
c) all of the mentioned
d) none of the mentioned

Answer: a
Clarification: If you want to send an email to multiple recipients then the following methods would be used to specify multiple email IDs:
void addRecipients(Message.RecipientType type, Address[] addresses) throws MessagingException.

3. void addRecipients(Message.RecipientType type, Address[] addresses)
Parameter:-
type: This would be set to:-
a) TO
b) CC
c) BCC
d) All of the mentioned

Answer: d
Clarification: This would be set to TO, CC or BCC. Here CC represents Carbon Copy and BCC represents Black Carbon Copy. Example Message.RecipientType.TO.

4. void addRecipients(Message.RecipientType type, Address[] addresses)
Parameter:-
addresses: This is the array of email ID, the method used while specifying email IDs
a) Internet
b) InternetAddress
c) BCC
d) All of the mentioned

Answer: b
Clarification: Addresses: This is the array of email ID. You would need to use the InternetAddress() method while specifying email IDs.

5. To set content whose second argument is “text/html” to specify that the HTML content is included in the message.
a) setContent
b) content
c) setMail
d) none of the mentioned

Answer: a
Clarification: setContent() method to set content whose second argument is “text/html” to specify that the HTML content is included in the message.

6. If it is required to provide user ID and Password to the email server for authentication purpose then you can set properties:
a) props.setProperty(“mail.user”, “myuser”)
b) props.setProperty(“mail.password”, “mypwd”)
c) all of the mentioned
d) none of the mentioned

Answer: c
Clarification: If it is required to provide user ID and Password to the email server for authentication purpose then you can set these properties as follows:

props.setProperty(“mail.user”, “myuser”);
props.setProperty(“mail.password”, “mypwd”);

7. It is assumed that your localhost is connected to the internet and capable enough to send an email.
a) True
b) False

Answer: a
Clarification: To send an HTML email from your machine.

8. The JavaMailSender interface is a subinterface of MailSender that includes specialized JavaMail features:-
a) Multipurpose Internet Mail Extensions
b) Multipurpose Internet Mail
c) Multipurpose Internet Extensions
d) None of the mentioned

Answer: a
Clarification: The JavaMailSender interface is a subinterface of MailSender that includes specialized JavaMail features such as Multipurpose Internet Mail Extensions (MIME) message support. To send an email message with HTML content, inline images, or attachments, you have to send it as a MIME message.

9. You can implement the interface to send email notifications in case of errors.
a) Notify
b) Error
c) ErrorNotifier
d) None of the mentioned

Answer: c
Clarification: You can implement the ErrorNotifier interface to send email notifications in case of errors.

10. You send the email by making a call to:-
a) Transport.send()
b) Transport.sendTo()
c) All of the mentioned
d) None of the mentioned

Answer: a
Clarification: You send the email by making a call to Transport.send().

To practice puzzles on all areas of Java Spring,

250+ TOP MCQs on AspectJ Annotation and Answers

Java Spring Multiple Choice Questions & Answers (MCQs) on “AspectJ Annotation”.

1. Which tag informs the spring container about the use of AspectJ annotation?
a) aop:aspectj-autowire
b) aop:aspectj-name
c) aop:aspectj-autoproxy
d) none of the mentioned
Answer: c
Clarification: To enable AspectJ annotation support in the Spring IoC container, you only have to define an empty XML element aop:aspectj-autoproxy in your bean configuration file.

2. Which of the following is advice supported by Aspect Annotation?
a) @Before
b) @After
c) @AfterReturning
d) All of the mentioned
Answer: d
Clarification: AspectJ supports five types of advice annotations: @Before, @After, @AfterReturning, @AfterThrowing, and @Around.

3. An advice is an action which comes into play at pointcuts.
a) True
b) False
Answer: b
Clarification: A pointcut is an expression to match a set of join points, while an advice is the action to take at a particular join point.

4. Which advice is executed once a joint point finishes?
a) @Before
b) @After
c) @AfterReturning
d) @AfterThrowing
Answer: b
Clarification: An after advice is executed after a join point finishes, whenever it returns a result or throws an exception abnormally.

5. Which advice is executed only when joint point returns or throws an exception?
a) @Before
b) @After
c) @AfterReturning
d) @AfterThrowing
Answer: c
Clarification: If you would like to perform logging only when a join point returns, you should replace the after advice with an after returning advice.

6. Which advice combines all advices into one?
a) @Before
b) @After
c) @AfterThrowing
d) None of the mentioned
Answer: d
Clarification: It gains full control of a join point, so you can combine all the actions of the preceding advices into one single advice. You can even control when, and whether, to proceed with the original join point execution.

7. An advice can access the current join point information by declaring an argument of type org.aspectj.lang.AdvicePoint in the advice method signature.
a) True
b) False
Answer: b
Clarification: An advice can access the current join point information by declaring an argument of type org.aspectj.lang.JoinPoint in the advice method signature.

8. Which interface is implemented to specify precedence of aspects?
a) Ordered
b) ApplicationAspect
c) AspectPointcut
d) None of the mentioned
Answer: a
Clarification: The precedence of aspects can be specified either by implementing the Ordered interface.

9. Alternative annotative way to specify precedence of aspects?
a) @Order
b) @Aspect
c) @PointCut
d) None of the mentioned
Answer: a
Clarification: The precedence of aspects can be specified either by implementing the Ordered interface or @Order Annotation.

10. Method which returns the highest priority of aspect’s join point?
a) getHighestPriority
b) getOrder
c) getHighOrder
d) getPriority
Answer: b
Clarification: The lower value returned by the getOrder() method represents higher priority.

11. 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();
	    // ...[/expand]
	  }
 
    }

a) Runtime Error
b) IllegalArgumentException
c) BeanCreation Exception
d) None of the mentioned
Answer: c
Clarification: The throwing keyword in pointcut annotation doesn’t matches with the method’s parameter exception.

12. Which instantiation model is supported by AspectJ?
a) perthis
b) pertarget
c) none of the mentioned
d) all of the mentioned
Answer: d
Clarification: Spring supports AspectJ perthis and pertarget instantiation models.

13. Which instantiation model is supported by AspectJ?
a) perthis
b) pertarget
c) none of the mentioned
d) all of the mentioned
Answer: c
Clarification: percflow, percflowbelow, and pertypewithin are not currently supported.

14. Which tag in XML is used to declare @Before advice’s method?
a) aop:before
b) aop:after
c) aop:afterthrow
d) None of the mentioned
Answer: a
Clarification: Before advice runs before a matched method execution. It is declared inside an aop:aspect using the aop:before element.

15. Which tag in XML is used to declare @Before advice’s method?
a) aop:before
b) aop:after-returning
c) aop:afterthrow
d) None of the mentioned
Answer: b
Clarification:- After returning advice runs when a matched method execution completes normally. It is declared inside an aop:aspect in the same way as before advice.