Which two interfaces should you implement?

You are modifying an existing application that manages employee payroll. The application
includes a class named PayrollProcessor. The PayrollProcessor class connects to a payroll
database and processes batches of paychecks once a week.
You need to ensure that the PayrollProcessor class supports iteration and releases
database connections after the batch processing completes.
Which two interfaces should you implement? (Each correct answer presents part of the
complete solution. Choose two.)

You are modifying an existing application that manages employee payroll. The application
includes a class named PayrollProcessor. The PayrollProcessor class connects to a payroll
database and processes batches of paychecks once a week.
You need to ensure that the PayrollProcessor class supports iteration and releases
database connections after the batch processing completes.
Which two interfaces should you implement? (Each correct answer presents part of the
complete solution. Choose two.)

A.
IEquatable

B.
IEnumerable

C.
IDisposable

D.
IComparable

Explanation:
B: IEnumerable
C: IDisposable Interface
Exposes an enumerator, which supports a simple iteration over a non-generic collection.
Defines a method to release allocated resources.
The primary use of this interface is to release unmanaged resources.



Leave a Reply 1

Your email address will not be published. Required fields are marked *


PaulC

PaulC

answer BC

IEnumerable to implement iteration
IDisposable to implement disposing connecions