6.2. Class members

In addition to instance and static variables, other classes (inner classes), and methods, a C# class can include many other different members. Class members can be divided into two categories:

  • data members

  • function [1] members.

    [1] This is a terminology thing – the word 'function' (as in function member) does not mean just 'methods'. In OO languages, a method is simply another name for 'function', and some OO developers who graduated from traditional structured programming schools still use the term function to refer to method. In C#, function members include methods and properties, events, indexers, operators, instance constructors, destructors, and static constructors.

Members that can contain executable code are known as ...

Get From Java to C#: A Developer's Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.