Understanding OOP
Object-oriented programming is a paradigm that allows us to write a program around objects. As discussed in the previous chapter, objects contain data and methods to act on that data. Each object has its own set of data and methods. If an object wants to access the data of another object, it has to access it via the methods defined in that object. An object can inherit the properties of another object using the concept of inheritance. Hence, we can say that object-oriented programming is organized around data and the operations that are permitted on the data.
C# is a general-purpose multi-paradigm programming language. OOP is only one of these paradigms. Other supported paradigms, such as generic and functional programming, will be discussed in later chapters.
When discussing object-oriented programming, it is important to understand the differences between classes and objects. As mentioned already, in the previous chapter, a class is a blueprint that defines...