Information Technology Reference
In-Depth Information
Example of Member Access
Class C1 declares both public and private fields and methods. Figure 4-6 illustrates the visibility
of the members of class C1 .
class C1
{
int F1; // Implicit private field
private int F2; // Explicit private field
public int F3; // Public field
void DoCalc() // Implicit private method
{
...
}
public int GetVal() // Public method
{
...
}
}
Figure 4-6. Private and public class members
Search WWH ::




Custom Search