Member Access
How to access members of an object x
| object member | class member | namespace member | |||
|---|---|---|---|---|---|
| method | field | property | |||
| ABAP Objects | x->method(«parameters»). | x->field | x=>field or x=>method(«parameters»). | ||
| C++ (STL) | x.method(parameters) or ptr->method(parameters) |
x.field or ptr->field |
cls::member | ns::member | |
| Objective-C | x->field | x.property (2.0 only) or |
|||
| Smalltalk | x method«:parameter «bar:parameter ...»» | cls method«:parameter «bar:parameter ...»» | |||
| C# | x.method(parameters) | x.field | x.property | cls.member | ns.member |
| Java | |||||
| D | x.property | ||||
| Python | |||||
| Visual Basic .NET | |||||
| Windows PowerShell | ::member | ||||
| F# | cls.member | ||||
| Eiffel | x.method«(parameters)» | x.field | {cls}.member | ||
| Ruby | x.property | cls.member | |||
| PHP | x->method(parameters) | x->field | x->property | cls::member | ns\member |
| Perl | x->method«(parameters)» | x->{field} | cls->method«(parameters)» | ns::member | |
| Perl 6 | x.method«(parameters)» or x!method«(parameters)» |
x.field or x!field |
cls.method«(parameters)» or cls!method«(parameters)» |
ns::member | |
| OCaml | x#method «parameters» | ||||
| JavaScript | x.method(parameters) x(parameters) |
x.field x |
x.property x |
||
Read more about this topic: Comparison Of Programming Languages (object-oriented Programming)
Famous quotes containing the words member and/or access:
“Luckless is the country in which the symbols of procreation are the objects of shame, while the agents of destruction are honored! And yet you call that member your pudendum, or shameful part, as if there were anything more glorious than creating life, or anything more atrocious than taking it away.”
—Savinien Cyrano De Bergerac (16191655)
“In the greatest confusion there is still an open channel to the soul. It may be difficult to find because by midlife it is overgrown, and some of the wildest thickets that surround it grow out of what we describe as our education. But the channel is always there, and it is our business to keep it open, to have access to the deepest part of ourselves.”
—Saul Bellow (b. 1915)