
17 Classes
17.2 Class members
17.2.6 Nested types
17.2.6.2 Declared accessibility
Paragraph 11 Non-nested types can have public or internal declared accessibility and they have internal declared accessibility by default. 2 Nested types can have these forms of declared accessibility too, plus one or more additional forms of declared accessibility, depending on whether the containing type is a class or struct:
public class List
{
// Private data structure
private class Node
{
public object Data;
public Node Next;
public Node(object data, Node next) {
this.Data = data;
this.Next = next;
}
}
private Node first = null;
private Node last = null;
// Public interface
public void AddToFront(object o) {...}
public void AddToBack(object o) {...}
public object RemoveFromFront() {...}
public object AddToFront() {...}
public int Count { get {...} }
}
declares a private nested class Node. end example]
| |
| Jagger Software Ltd | |
| Company # 4070126 | |
| VAT # 762 5213 42 |