Access Specifier

Why Trust Techopedia

What Does Access Specifier Mean?

An access specifier is a defining code element that can determine which elements of a program are allowed to access a specific variable or other piece of data. Different programming languages have their own protocols for access specifiers, as well as defaults for some code elements including both individual variables and classes.

Advertisements

Techopedia Explains Access Specifier

Two of the most common access specifiers are "public" and "private." Where a program may include elements that are public or private by default, programmers can often change their status by defining, or "declaring," the element with either the word "public" or "private."

Programmers define code elements and pieces of data as public or private for various reasons. A public status is good for code elements that are valuable to various outside functions, but for items that can be easily changed, where those changes affect the solvency of the code, a private status can be helpful. There are other pros and cons to private and public access specifiers, including errors and glitches after alterations of public items, and run-time errors related to inaccessible private items.

Advertisements

Related Terms

Margaret Rouse
Technology expert
Margaret Rouse
Technology expert

Margaret is an award-winning writer and educator known for her ability to explain complex technical topics to a non-technical business audience. Over the past twenty years, her IT definitions have been published by Que in an encyclopedia of technology terms and cited in articles in the New York Times, Time Magazine, USA Today, ZDNet, PC Magazine, and Discovery Magazine. She joined Techopedia in 2011. Margaret’s idea of ​​a fun day is to help IT and business professionals to learn to speak each other’s highly specialized languages.