Tutorial by Topics: modifiers



Non-Access Modifiers do not change the accessibility of variables and methods, but they do provide them special properties.

Regular expression patterns are often used with modifiers (also called flags) that redefine regex behavior. Regex modifiers can be regular (e.g. /abc/i) and inline (or embedded) (e.g. (?i)abc). The most common modifiers are global, case-insensitive, multiline and dotall modifiers. However, regex flavors differ in the number of supported regex modifiers and their types.

There are some frequently used operations like event.preventDefault() or event.stopPropagation() inside event handlers. Although we can do this easily inside methods, it would be better if the methods can be purely about data logic rather than having to deal with DOM event details.

In Kotlin, there are 4 types of visibility modifiers are available.

Public: This can be accessed from anywhere.

Private: This can only be accessed from the module code.

Protected: This can only be accessed from the class defining it and any derived classes.

Internal: This can only be accessed from the scope of the class defining it.

Access control(scope) to various methods, data members, initialize methods.


Page 1 of 1