Clever Geek Handbook
📜 ⬆️ ⬇️

Method (programming)

A method in object-oriented programming is a function or procedure that belongs to some class or object .

Like a procedure in procedural programming , a method consists of a number of operators for performing an action and has a set of input arguments .

There are simple methods and static methods (class methods):

  • simple methods have access to the data of an object (a specific instance of a given class),
  • static methods do not have access to object data, and to use them, you do not need to create instances (of this class).

Methods provide an interface through which access to the data of an object of a certain class is carried out, thereby ensuring data encapsulation .

Depending on what level of access this or that method provides, allocate:

  • open ( public ) interface - a common interface for all users of this class;
  • protected interface - an internal interface for all descendants of this class;
  • private interface - an interface that is accessible only from within this class.

This separation of interfaces allows you to keep the open interface unchanged, but change the internal implementation.

See also

  • Property
  • Event


Source - https://ru.wikipedia.org/w/index.php?title= Method_ ( programming)&oldid = 88691646


More articles:

  • Confederation of Volleyball North, Central America and the Caribbean
  • Remohadas
  • FROG
  • Cytoplasm Inclusions
  • Louise of Savoy
  • Romanenko, Peter Logvinovich
  • Obolon-2
  • Pan American Women's Volleyball Cup
  • 1920 South American Football Championship
  • Akhmat Kadyrov Square

All articles

Clever Geek | 2019