Call an object method: Difference between revisions

m
m (→‎{{header|Phix}}: added syntax colouring, marked p2js incompatible)
Line 309:
 
<lang dyalect>//Static method on a built-in type Integer
static func Integer.divDiv(x, y) {
x / y
}
 
//Instance method
func Integer.divDiv(n) {
this / n
}
 
print(Integer.divDiv(12, 3))
print(12.divDiv(3))</lang>
 
{{out}}
Anonymous user