Skip to main content
C# / .NET Bug Hunt Hard +35 XP

Interface Not Implemented

This code won't compile.

C# / .NETFind the bug
1interface IShape { double Area(); }
2class Circle : IShape { double radius; }
The bug is on line 2

Select the correct fix

Show answer and explanation

Answer: Implement Area() method in Circle

When a class implements an interface, it MUST implement all interface members. Circle is missing the Area() method.

Hint: Interface members are contracts that must be fulfilled.

What this challenge tests

Bug Hunt in C# / .NET: interfaces, contracts.

Related challenges