class Person {
private _age = 2
public get age() {
return _age
}
protected year = 1990
}
pub
class Person
|int| age
setter age
expect (value >= 0) ("bad age $value set!")
.age = value
main
|| p = person()
p.age = -1 // calls a function rather than the property
|| n = p.age // reads the property directly!
Languages with Access Modifiers include Java, C++, PHP, TypeScript, C#, Swift, Kotlin, Solidity, F#, Protocol Buffers, ABAP, C3, Koka, C2, Apex, Jule, Sophia, Speedie
Languages without Access Modifiers include JavaScript, C, progsbase
View all concepts with or missing a hasAccessModifiers measurement
Read more about Access Modifiers on the web: 1.