Top 1K Features Creators Events Podcasts Books Extensions Interviews Blog Explorer CSV

Access Modifiers

< >
Example from 1 languages: TypeScript
class Person { private _age = 2 public get age() { return _age } protected year = 1990 }
Example from 1 languages: MoonBit
pub struct R2 { // 显式的公共结构 x: Int // 隐式的公共字段 pub y: Int // WARNING: `pub` 是多余的! priv z: Int // 显式的私有字段 }
Example from 1 languages: Jule
pub
Example from 1 languages: Speedie
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, MoonBit, 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.

- Build the next great programming language · Add · Issues · About · Search · Keywords · Livestreams · Labs · Resources · Acknowledgements