answersLogoWhite

0

Accessors: getValue

Mutators: setValue

Example:

class MyClass {

int num;

int getNum() {

return num;

}

void setNum(int num) {

this.num = num;

}

}

User Avatar

Wiki User

15y ago

What else can I help you with?

Continue Learning about Engineering

What layer does the encapsulation method takes place?

If you want maintainability, flexibility, and extensibility (and I guess, you do), your design must include encapsulation. How do you do that? • Keep instance variables protected (with an access modifier, mostly private). • Make public accessor methods, and force calling code to use those methods rather than directly accessing the instance variable. • For the methods, use the JavaBeans naming convention of set and get.


Specify the naming convention for variable constant class and method?

The naming convention for variables, constants, classes, and methods involves delimiting separate words with a non-alphanumeric character such as a hyphen or underscore.


What extension saves an external style sheet?

When you create an external style sheet for your Web pages, you should name the file following similar naming conventions for your HTML files. When you save it, you use the file extension .css so the browser will recognize that it is a CSS stylesheet.


What are the rules for naming variables in java?

Some basic conventions are:1. you cannot have keywords as names2. All identifiers have to start with an alphabet3. Except '_' and '$' no other special character is allowed in names4. When there are multiple words in an identifier we usually capitalize the first alphabets of each word. For example if an identifier represents name of employee then we name it as nameOfEmployee. The first word would remain normal with no capitalizationetc...


Why are some variables capitalized?

Unless a language has strict rules regarding naming conventions, how we name our variables is really a matter of personal style. In C and C++ we generally prefer all lowercase with underscores separating each word as this helps readability and retains consistency with standard library conventions. Using a leading capital typically denotes something of importance, but is usually applied to a user-defined type rather than to a variable. Uppercase names are generally avoided because macros are conventionally named using all uppercase so they stand out. Other languages have other conventions, but a leading capital typically has no real meaning unless it is dictated by some language rule.

Related Questions

How do you explain the naming conventions used to identify internet host company?

Naming conventions are used to identify ip addresses and things of that nature. They use various system names and methods for each different naming convention.


What are text conventions?

slogans, branding and product naming.


What are the two methods of naming sets?

what are the two method naming sets


What two functions of encapsulation?

If you want maintainability, flexibility, and extensibility (and I guess, you do), your design must include encapsulation. How do you do that? • Keep instance variables protected (with an access modifier, mostly private). • Make public accessor methods, and force calling code to use those methods rather than directly accessing the instance variable. • For the methods, use the JavaBeans naming convention of set and get.


How do you determine the naming conventions for amino acids?

Amino acids are named based on their chemical structure and properties. The naming conventions typically involve using a combination of letters and numbers to represent the specific characteristics of each amino acid.


What are naming conventions in active directory based on?

LDAP (Lightweight Directory Access Protocol)


What is the common use for carbohydrates?

In organic chemistry naming conventions, carbohydrates have -ose as the suffix.


What layer does the encapsulation method takes place?

If you want maintainability, flexibility, and extensibility (and I guess, you do), your design must include encapsulation. How do you do that? • Keep instance variables protected (with an access modifier, mostly private). • Make public accessor methods, and force calling code to use those methods rather than directly accessing the instance variable. • For the methods, use the JavaBeans naming convention of set and get.


How are chords named and what is the significance of their naming conventions?

Chords are named based on the notes they contain and their relationship to the root note. The naming conventions help musicians understand the structure and function of chords in a piece of music, making it easier to play and analyze.


What does the abbreviation 'TLD' stand for?

Top Level Domain in Internet domain naming conventions/protocol.


Naming or addressing conventions in active directory are based on the?

LDAP (Lightweight Directory Access Protocol)


How can one determine the naming conventions for hydrates?

To determine the naming conventions for hydrates, one must identify the compound's chemical formula and the number of water molecules attached to it. The naming convention typically involves stating the name of the compound followed by a numerical prefix indicating the number of water molecules present, and ending with the word "hydrate."