- . - , , , . , , .
. - , :
, , .
- :
- Pascal. Delphi 7 Delphi. Object Pascal - .
- C++ , . , , , , , .
- Java - -, Java. . : Standard Edition, Enterprise Edition, Micro Edition, Card.
- JavaScript web-. Java. Ecmascript. Ecmascript , JScript, ActionScript.
- Objective-C , Objective-C.
- Perl - . , . , , , . .
- PHP. . -, . gui- PHP-GTK, PHP-Qt, WinBinder.
- Python - , . Cython, , Python .
“- ” - . . , , .
. . .
: .
- - .
, . , , , . , , , . - .
:
, - . .
:
class Animal {
function draw() {
return "just animal";
}
function eat() {
return "the animal is eating";
}
}
class Cow extends Animal {
function draw() {
Return "something that looks like a cow";
}
}
, class Cow class Animal. , Cow.eat(), "the animal is eating", , draw() . Cow.draw() “something that looks like a cow”, Animal.draw() “just animal”.
, . private.
, . , , .
class Animal {
private $name;
function __construct($name) {
$this->name = $name;
}
function getName() {
return $this->name;
}
}
Name . , name. , , .
, .
. class CardDesk class GraphicalObject. draw(). , .
Ad hoc :
, .
. - , , , - .
« — » .
- , .
. , . :
, . , . , - .
. - .
Object Pascal :
ClassName = class(SuperClass)
private
{ }
{ }
strict private
{ Delphi 2007, , private }
protected
{ ClassName }
public
{ }
published
{ , Object Inspector'e }
end;
SuperClass - , .
C++ :
class MyClass: public Parent
{
public:
MyClass(); //
~MyClass(); //
protected:
private:
};
Parent , . private, public, protected , . , , . C++ private, , .
- - , . :
. , - , , . , .
- , , . . , .
-
:
- - , . , , . - Java, “JavaBeans”, .
- . - javascript ecmascript, lua lo. :
. , , .
-
- , . , .
:
, :
, - . , . , - . -.
, . , PHP JavaScript , , - . Java : -, , , -, . C# . , Java, . , Oz, , , .