After studying this book up to chapter fourteen, we are now able to write a simple program using C#. Readers should note that we write various programs in which we use a class-like structure. Then we created a function called main in that class. The class name is based on the project name. Why is this so? We need to know the structure of C#. Fundamentally C# is an object-oriented language. Now a new question appears: what does object-oriented mean? Is this another new language that C# is based on, or is C# a language derived from OOP (object-oriented programming)? The answer is that OOP is not a language, it's just a technique and C# is a programming language that uses this technique. In this chapter we will talk about OOP and its basic concepts. Say no to plagiarism. Get a tailor-made essay on "Why Violent Video Games Shouldn't Be Banned"? Get an Original EssayOOP (Object Oriented Programming) is a widely seen programming concept. In this book we use C# as the programming language. That's why you need to know OOP. OOP is a technique on how to program. It is advantageous compared to the structured approach. It's easy to find bugs and errors if we use oop. But in structural approach it becomes difficult for a programmer. In structural approach if an error occurs then the only programmer of that code can find the error or bug and fix it easily, if they try to fix the error without the developer of that project then it costs a lot. But in the OOP this rigidity has been removed. Oop is economical in this way compared to the structured approach. OOP is a totally class and object based technique.Basic object oriented concept:There are some basic concepts of object oriented programming which include classes, objects, association, composition, aggregation and the four main pillars of OOP which are the following: Inheritance: Provides a feature called code reusability. In inheritance we reuse code. There is a base class which sounds like parent class and a class called kids class which is inherited or derived from the base or parent class. The details of this chapter will be provided in the next chapter no. 16. Polymorphism: It is clear from its name polymorphism that something is going the same way. It gives us the ability to create multiple functions with the same name but different parameters providing different outputs. A real example is a family with the same surname. This will be explained later in chapter no. 17. Encapsulation: It is all about data binding and provides us with the ability to bind functions and data in the same class. A real-world example is capsule.Abstraction: This is based on encapsulation and hiding of data. Hides details and shows only the essential part or features of the application. In the real world mobile phones are a great example of abstraction, for example; we don't know the inside details while calling someone or using the service. Defining Classes and Objects: Classes and Objects: Classes are defined as user-defined data types. They explain the types of objects. Sometimes these two terms are used correspondingly. But in the real object there is an instance of the class. If we take the analogy between sketch and painting, then the class is just a sketch and the object is a colored painting of that sketch. If we use the constructive approach, the class is just a blue print and the object is completely prepared by building from that blueprint. Please note: this is just an example. Get a custom paper from our expert writers now. Get a custom essay Basically, the.
tags