• C# is inherently an object – oriented language
• Console is an object.
• Objects are everyone.
• Program are a collection of objects, they can communicate with each other and the
• Class – Most common types of c#
o Provides a blueprint, or a description of what an object looks like.
o What kinds of data an object of this type holds
o A class is not, however, the actual object itself.
o Classes are provided by .NET framework. An can define our own.
o Classes essentially define two major things ( called members)
o Field and Properties – what kinds of data the object holds and work with
o Methods – What the object can do – what its functionality is.
o Classes can inherit attributes and methods from other classes.
o Subclasses Class B: A from Class A
o Class A is called the Super Class.
o Instances – Used to create individual objects.
o Why use classes?
Helps abtracts ideas away from a specific implementation
Allows you to focus on the core parts of the program.
Also helps Encapsulate program functionality into understandable pieces
All have related data and logic are all kept in one place.
Helps organizes a program into natural parts that can be extended
Sometimes referred to as factoring
Create programs that mirror real world constructs and ideas.
o How to define a Class
Used the class keyword.
Use the class, then say new myClass //calls constructor. To use methods, use the “.” Dot operator.
Static members don’t require instantion to use them.
Instance members, get copied each time a new object is created
Static members belong to the entire class – there is only one
o Class access Modifiers.
You can only use the data in that class and you can choose to expose