Which is the correct implementation to use the PaymentProcessor interface class?

A developer must implement a CheckPaymentProcessor class that provides check processing payment capabilities that adhere to what defined for payments in the PaymentProcessor interface. public interface PaymentProcessor { void pay(Decimal amount); }

Which is the correct implementation to use the PaymentProcessor interface class?
A . Public class CheckPaymentProcessor implements PaymentProcessor {
public void pay(Decimal amount) {}
}
B . Public class CheckPaymentProcessor implements PaymentProcessor {
public void pay(Decimal amount);
}

C . Public class CheckPaymentProcessor extends PaymentProcessor {
public void pay(Decimal amount);
}
D . Public class CheckPaymentProcessor extends PaymentProcessor {
public void pay(Decimal amount) {}
}

Answer: B

Latest PDI Dumps Valid Version with 191 Q&As

Latest And Valid Q&A | Instant Download | Once Fail, Full Refund

Subscribe
Notify of
guest
1 Comment
Inline Feedbacks
View all comments
Chitta Ranjan Sahoo
Chitta Ranjan Sahoo
1 year ago

The correct answer should be ‘A’. The class implementing the interface has to declare the body of the method.