class Person {
private _age = 2
public get age() {
return _age
}
protected year = 1990
}
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!
pub
Languages with Access Modifiers include Java, C++, PHP, C#, Swift, Kotlin, TypeScript, Solidity, F#, ABAP, Protocol Buffers, C3, Speedie, Koka, Jule, Pizza, Apex, C2, Sophia, Oracle Java, Deesel, Real-Time Concurrent C, Static Typescript
Languages without Access Modifiers include JavaScript, C, Objective-C, progsbase, Tick C
This question asks: Does this language have access modifiers?
Read more about Access Modifiers on the web: 1.
HTML of this page generated by Features.ts