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

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
主站蜘蛛池模板: 孟连| 洪雅县| 彩票| 阿城市| 南康市| 彩票| 张家界市| 浑源县| 城口县| 凤冈县| 乌兰察布市| 休宁县| 来凤县| 昭通市| 峨山| 汾阳市| 灵宝市| 六枝特区| 买车| 勃利县| 利川市| 弥渡县| 区。| 繁峙县| 庆阳市| 黄平县| 始兴县| 南昌县| 象山县| 永清县| 综艺| 昆明市| 大悟县| 霍州市| 南宁市| 高安市| 中阳县| 稻城县| 绥化市| 军事| 高唐县|