Junior OOP

What is the syntax to implement an interface?

  • Use the colon (:) symbol and implement all members.

class Car : IDriveable

public int Speed { get; set; }

public void Drive() => Console.WriteLine("Car is driving");

More from C# Programming Tutorial

All questions for this course