Class Declaration
class | protocol | namespace | |
---|---|---|---|
ABAP Objects | class name definition «inheriting from parentclass». «interfaces: interfaces.» method_and_field_declarations endclass. class name implementation. method_implementations endclass. |
interface name. members endinterface. | |
C++ (STL) | class name« : public parentclasses» { members }; | namespace name { members } | |
C# | class name« : «parentclass»«, interfaces»» { members } | interface name« : parentinterfaces» { members } | |
D | module name; members |
||
Java | class name« extends parentclass»« implements interfaces» { members } | interface name« extends parentinterfaces» { members } | package name; members |
PHP | namespace name; members | ||
Objective-C | @interface name« : parentclass»«< protocols >» { instance_fields } method_and_property_declarations @end @implementation name method_implementations @end |
@protocol name«< parentprotocols >» members @end | |
Python | class name«(parentclasses)»: Tab ↹ members |
__all__ = | |
Visual Basic .NET | Class name« Inherits parentclass»« Implements interfaces» members End Class |
Interface name« Inherits parentinterfaces» members End Interface |
Namespace name members End Namespace |
Eiffel | class name« inherit parentclasses» members end |
||
Perl | package name; «@ISA = qw(parentclasses);» members 1; | package name; members | |
Perl 6 | class name «is parentclass «is parentclass ...»» «does role «does role ...»» { members } | role name «does role «does role ...»» { members } | module name { members } |
Ruby | class name« < parentclass» members end |
module name members end |
|
Windows PowerShell | |||
OCaml | class name «parameters» = object «(self)» «inherit parentclass «parameters» «inherit parentclass «parameters» ...»» members end | module name members |
|
F# | type name«(parameters)» «as this» = class «inherit parentclass«(parameters)» «as base»» members «interface interface with implementation «interface interface with implementation ...»» end | type name = interface members end | namespace name members |
Smalltalk | "The class is an Object. Just send a message to the superclass (st-80) or the destination namespace (Visualworks)" |
"The namespace is an Object. Just send a message to the parent namespace" |
Read more about this topic: Comparison Of Programming Languages (object-oriented Programming)
Famous quotes containing the words class and/or declaration:
“A theory of the middle class: that it is not to be determined by its financial situation but rather by its relation to government. That is, one could shade down from an actual ruling or governing class to a class hopelessly out of relation to government, thinking of govt as beyond its control, of itself as wholly controlled by govt. Somewhere in between and in gradations is the group that has the sense that govt exists for it, and shapes its consciousness accordingly.”
—Lionel Trilling (19051975)
“Let us stun and astonish the intruding rabble of men and books and institutions by a simple declaration of the divine fact. Bid the invaders take the shoes from off their feet, for God is here within.”
—Ralph Waldo Emerson (18031882)