In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly introduces "what language is C++". In daily operation, I believe many people have doubts about what language C++ is. The editor consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful to answer the doubts about "what language is C++?" Next, please follow the editor to study!
C++ is an object-oriented programming language
When you learn C++, you will always come across some concepts that have never been seen in C language, such as classes, objects, abstractions, encapsulation, inheritance, polymorphism, virtual functions and so on. These concepts are possessed by C++. Here is a brief introduction to C++ 's support and implementation of object-oriented programming methods.
1. C++ supports data encapsulation. Data encapsulation supports data abstraction. In C++, the class is the tool that supports data encapsulation, and the object is the implementation of data encapsulation. The process-oriented programming method is different from the object-oriented programming method in dealing with the relationship between data and functions. In object-oriented programming, the data and the functions that legally operate the data are encapsulated as the definition of a class, and the data will be hidden in the encapsulation, which exchanges information with the outside world through the operation interface.
The object is stated to have a variable of a given class, which is similar to the structure in C language. The structure can be defined in C language, but this structure contains data rather than functions. Classes in C++ are wrappers for data and functions. In C++, a structure can be used as a special class. Although it can contain functions, it has no private or protected members.
2. The C++ class contains private, public and protected members. The C++ class can define three different access control permissions. One is the private (Private) member, which can only be accessed by the function specified in the class, while the functions outside the class cannot access the private member; the other is the Public member, which can also be accessed outside the class and become the interface of the class; the other is the Protected member, which can only be accessed by the derived class of the class, and the rest cannot be accessed outside the class.
3. In C++, objects are processed by sending customs messages. In C++, objects are processed by sending customs messages to objects. Each object decides the action to be taken according to the nature of the received message in response to the message. Responding to these messages is a series of methods that are defined using functions in the class definition and send messages to an object using a mechanism similar to function calls.
4. C++ language allows friends to destroy private members of an encapsulated class. Generally, no functions outside the class are allowed to access it, but friends can break this prohibition by accessing private members of the class (including data members and member functions). A friend can be a function defined outside a class or an entire class defined outside a class. The former is called a friend function, and the latter is called a friend class. Friend breaks the encapsulation of the class, which is another important object-oriented animal of C++.
At this point, the study of "what language is C++" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.