Class instance variables
In this chapter you will learn:
Instance variabls
The general form for declaring an instance variable is shown here:
access type var-name;
access
specifies the access,type
specifies the type of variable, andvar-name
is the variable's name.
To access these variables, you will use the dot (.
) operator.
The dot operator links the name of an object with the name of a member.
The general form of the dot operator is shown here:
object.member
You can use the dot operator to access both instance variables and methods.
class MyClass
{
int simpleValue = 0;
}
Next chapter...
What you will learn in the next chapter:
Home » C# Tutorial » Class