Like:
Employee: Person
name: String
id: int
+ employeeCount(): int {
---------------
return employeecount
}
+ name():String {
return name;
}
- secret():void {
///private method
}
Objective C uses +
for class methods and -
for instance methods -- very different interpretation, but it's the only language I know that decorates methods with plus and minus signs like that;-).
The "name: type" notation (often enriched with a leading keyword such as var
for variables and function
for functions) was quite popular before C took over the world, most notably perhaps in Pascal (a now-somewhat-obscure language that had a credible bid of its own for world domination not all that long ago;-).