Basic concepts of OOP: "class", "object", "interface"

A class is a way to describe an entity, defining the state and behavior that depends on this state, as well as the rules for interacting with this entity (contract).

From a programming point of view, a class can be viewed as a set of data (fields, attributes, class members) and functions for working with them (methods).

From the point of view of program structure, a class is a complex data type.

An object (instance) is a separate representative of a class with a specific state and behavior that is completely determined by the class. Each object has specific attribute values ​​and methods that operate on those values ​​based on the rules defined in the class.

An interface is a collection of class methods available for use. The interface of a class will be a set of all its public methods together with a set of public attributes. Basically, an interface specifies a class, clearly defining all possible actions on it.


Read also:


Comments

Popular posts from this blog

Methods for reading XML in Java

XML, well-formed XML and valid XML

ArrayList and LinkedList in Java, memory usage and speed