© Vaskaran Sarcar 2018
Vaskaran SarcarInteractive C#https://doi.org/10.1007/978-1-4842-3339-9_2

2. The Building Blocks: Class and Objects

Vaskaran Sarcar
(1)
560066 Bangalore, Karnataka, India
 

Class

A class is a blueprint or a template. It can describe the behaviors of its objects. It is the foundation for how the object is built or instantiated.

Object

An object is an instance of a class.
Object-oriented programming (OOP) techniques primarily depend on these two concepts—class and objects . With a class, we are creating a new data type, and objects are used to hold the data (fields) and methods. Object behavior can be exposed through these methods.
If you are familiar with the game of football (or soccer, as it’s known in the United States), we know ...

Get Interactive C#: Fundamentals, Core Concepts and Patterns 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.