官术网_书友最值得收藏!

Hello OOP - Classes and Objects

Object-oriented programming (OOP) is something special. If you search the internet for books on OOP, you'll find hundreds of books on this topic. But still this topic will never become stale as it is the most efficient and most commonly used programming methodology in the industry. With the increase in the demand for software developers, there has also been an increase in the demand for good learning content. Our approach in this book is to describe the concepts of OOP in the simplest way. Understanding the basics of OOP is a must for developers who want to work with C#, as C# is a fully OOP language. In this chapter, we will try to understand what OOP actually is and the most basic concepts of OOP that are essential to begin our programming journey. Before anything else, let's first start by analyzing the meaning of the term object-oriented programming.

The first word is object. According to the dictionary, an object is something that can be seen, felt, or touched; something that has physical existence in the real world. If an item is virtual, this means that it doesn't have any physical existence and is not considered an object. The second word is oriented, which indicates a direction or something to aim for. For example, when we say that we are oriented toward the building, we mean that we are facing towards it. The third word is programming. I believe I don't have to explain what programming is, but in case you are totally unaware of what programming is and are reading this book to learn, let me explain briefly what programming is. Programming is just giving instructions to the computer. As the computer doesn't speak our language, we humans have to give instructions to the computer in a language that the computer understands. We humans call these instructions computer programs, as we are guiding or instructing a computer to do a particular thing.

Now that we know the definitions of those three keywords, if we put all these words together, we can understand the meaning of the phrase object-oriented programming. OOP means that we write our computer programs by keeping objects at the center of our thinking. OOP is neither a tool nor a programming language—it is just a concept. Some programming languages are designed to follow this concept. C# is one of the most popular object-oriented languages. There are other object-oriented languages, such as Java, C++, and so on.

In OOP, we try to think about our software components as small objects, and create relationships between them to solve a problem. You may have came across this approach with other programming concepts in the programming world, such as procedural programming, functional programming, and other kinds of programming. One of the most popular computer programming languages of all time—the C programming language—is a procedural programming language. F# is an example of a functional programming language.

In this chapter, we will cover the following topics of OOP:

  • Classes in OOP
  • The general form of a class
  • What is an object?
  • Methods in a class
  • Characteristics of OOP
主站蜘蛛池模板: 蛟河市| 舞钢市| 聊城市| 铅山县| 鄂温| 腾冲县| 集贤县| 西吉县| 阳朔县| 铜山县| 临高县| 楚雄市| 互助| 新郑市| 额敏县| 莱芜市| 耒阳市| 改则县| 和林格尔县| 平罗县| 芦溪县| 色达县| 昆明市| 景洪市| 绿春县| 浦北县| 饶平县| 钦州市| 修水县| 灵丘县| 平阳县| 灯塔市| 探索| 朔州市| 岐山县| 玛纳斯县| 屏边| 施甸县| 通州市| 磴口县| 镇平县|