nerdexam
Salesforce

PDI · Question #136

A developer must create a DrawList class that provides capabilities defined in the Sortable and Drawable interfaces. public interface Sortable { void sort(); } public interface Drawable { void…

The correct answer is C. Public class DrawList implements Sortable, Drawable { public void sort() { /*implementation*/}. To implement multiple interfaces in Apex, a class must use the implements keyword followed by a comma-separated list of interface names, and then provide concrete implementations for all methods defined in those interfaces.

Submitted by anna_se· Apr 18, 2026Logic and Process Automation

Question

A developer must create a DrawList class that provides capabilities defined in the Sortable and Drawable interfaces. public interface Sortable { void sort(); } public interface Drawable { void draw(); } Which is the correct implementation?

Options

  • APublic class DrawList implements Sortable, Implements Drawable { public void sort()
  • BPublic class DrawList extends Sortable, Drawable {
  • CPublic class DrawList implements Sortable, Drawable { public void sort() { /implementation/}
  • DPublic class DrawList extends Sortable, extends Sortable, extends Drawable { public void sort()

How the community answered

(48 responses)
  • A
    2% (1)
  • B
    2% (1)
  • C
    92% (44)
  • D
    4% (2)

Why each option

To implement multiple interfaces in Apex, a class must use the `implements` keyword followed by a comma-separated list of interface names, and then provide concrete implementations for all methods defined in those interfaces.

APublic class DrawList implements Sortable, Implements Drawable { public void sort()

The `implements` keyword should only be used once in the class declaration, followed by a comma-separated list of all interfaces to be implemented.

BPublic class DrawList extends Sortable, Drawable {

The `extends` keyword is used for inheritance between classes, not for implementing interfaces, which requires the `implements` keyword.

CPublic class DrawList implements Sortable, Drawable { public void sort() { /*implementation*/}Correct

The correct syntax for a class implementing multiple interfaces is to use the `implements` keyword once, followed by a comma-separated list of interface names, and then define all required methods from those interfaces.

DPublic class DrawList extends Sortable, extends Sortable, extends Drawable { public void sort()

The `extends` keyword is used incorrectly for interface implementation, and the syntax for listing multiple interfaces or superclasses is also incorrect.

Concept tested: Apex interface implementation syntax

Source: https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_interfaces.htm

Topics

#Apex#Interfaces#Object-Oriented Programming#Class Implementation

Community Discussion

No community discussion yet for this question.

Full PDI Practice