in reply to difference b/w API and a class

There's no relation between the two.

A library's or OS's API refers to the interface used to communicate with that library or OS. An API may rely on the use of objects and classes. Or not.

A class is a data structure whose instances are called objects. Objects encapsulate data in the form of attributes. Methods defined in the class are used to operate on the attributes.

Replies are listed 'Best First'.
Re^2: difference b/w API and a class
by pajout (Curate) on Oct 22, 2009 at 12:08 UTC
    Just small addition:

    Classes are good for implementation of stateless API.

    Objects are good for implementation of API with some states. For instance, the instance of API can keep database connection or authentication credentials according to specified rules.