Lecture overview -- Keyboard shortcut: 'u'  Previous page: Classes in C# -- Keyboard shortcut: 'p'  Next page: Instance Variables -- Keyboard shortcut: 'n'  Lecture notes - all slides and notes together  slide -- Keyboard shortcut: 't'  Help page about these notes  Alphabetic index  Course home  Page 12 : 29
Object-oriented Programming in C#
Classes and Objects
Overview of members in classes

Both variables and methods come in two different flavors: instance related and class related. Class related variables and methods are known as static members in C#.

The most important members of a class are variables and methods.

  • Instance variable

    • Defines state that is related to each individual object

  • Class variable

    • Defines state that is shared between all objects

  • Instance method

    • Activated on an object. Can access both instance and class variables

  • Class method

    • Accessed via the class. Can only access class variables

Class variables and class methods are marked with the modifier static.

No modifier is used for instance variables and instance methods.

On the following four pages we will study instance variables, instance methods, class variables and class methods in relatively great detail. If you do not need this level of detail can can skip these pages, and continue here.