Computer Programming
The Difference Between

What is the difference between a class and an interface?

User Avatar
Wiki User
2015-01-19 20:38:19

A class is a data type. An interface consists of the private,

protected and public members of a class, allowing consumers of the

class to interact with the class representation in a controlled

manner. The private interface is only accessible to the class

itself and to friends of the class. The protected interface is

similar to the private interface but is also accessible to

derivatives of the class. The public interface is fully accessible.

The private and protected interfaces are intended purely for use by

the class implementers while the public interface is intended for

use by both consumers and implementers.


Copyright © 2020 Multiply Media, LLC. All Rights Reserved. The material on this site can not be reproduced, distributed, transmitted, cached or otherwise used, except with prior written permission of Multiply.