O'Reilly logo

Design Patterns in C# by Steven John Metsker

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Appendix B. Solutions

Introducing Interfaces

Solution 2.1

from page 10

An abstract class with no non-abstract methods is similar to an interface in terms of its utility. However, note the following:

  • A class can implement any number of interfaces, but can subclass at most one abstract class.

  • An abstract class can have non-abstract methods; all the methods of an interface are effectively abstract.

  • An abstract class can declare and use variables; an interface cannot.

  • An abstract class can have methods whose access is public, internal, protected, protected internal, or private. Interface members implicitly have public access, and no access modifiers (including public) are allowed on interface member declarations.

  • An abstract class can define constructors; ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required