Home > Articles > Programming > C#

  • Print
  • + Share This
This chapter is from the book

Classes in C#

Now that you have a basic understanding of object-oriented and component-oriented programming, it is time to see how C# enables these concepts to become reality by using classes. You have actually already used classes in the examples and exercises from the previous two hours.

Classes in C# are reference types that implicitly derive from object. To define a class, you use the class keyword. Look at the application you built at the end of Hour 1, "The .NET Framework and C#." Everything you did was inside a class named Program.

The body of the class, defined by the opening and closing braces, is where you define the data and behavior for the class.

  • + Share This
  • 🔖 Save To Your Account