In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly introduces java object-oriented three characteristics is what, the text is very detailed, has a certain reference value, interested friends must read!
Programming languages come out, mostly talk about process-oriented development; later the emergence of Java, brought new development ideas, object-oriented development, so there has been object-oriented analysis (OOA), object-oriented design (OOD), object-oriented programming (OOP) and other new system development model research, and Java is the most object-oriented programming language, rapidly hot, received everyone respected. We have received the basic object-oriented concepts and characteristics of java:
Java basic concepts
Java is an object-oriented programming language, and objects are at the heart of object-oriented programming. The so-called object is the entity in the real world, and the object and entity are one-to-one corresponding, that is to say, every entity in the real world is an object, which is a concrete concept. Objects have the following characteristics:
Objects have properties and behaviors.
Objects have varying states.
Objects are unique.
Objects are instances of a class.
Everything is an object, and everything in the real world can be considered an object.
For example: In real-world schools, there will be entities such as students and teachers. Students have attributes (data) such as student number, name, class, etc. Students also have operations such as learning, asking questions, eating and walking. Students are abstract descriptions, and this abstract description is called a "class." In the school activities are individual students, namely Zhang, Li, etc. These specific individuals are called "objects,""objects" are also called "examples."
Java object-oriented three characteristics (encapsulation, inheritance, polymorphism)
Encapsulation: A programming mechanism that binds code and the data it processes together, ensuring that both programs and data are protected from external interference and misuse. Its advantages are as follows:
(1) . Protects information in a class that prevents externally defined code from accessing internal code and data at will.
(2) . Hide internal implementation details;
(3) . It is helpful to establish loose coupling relationship between each system and improve the independence of the system.
Inheritance: Subclasses have all the characteristics and behaviors of their parent classes. This is a relationship between classes. (Note: Java has only single inheritance and multiple implementations (interfaces))
Polymorphism: Polymorphism manifests itself in properties and methods defined in a parent class that can have different properties or behavior after they are inherited by a child class. Polymorphism allows an interface to be used by more than one of its kind, making up for single inheritance.
To sum up, it can be summarized as follows:
(1) . Reusability: code reuse, reduce code volume, improve development efficiency;
(2) . Extensibility: new functionality can be easily added to the system to facilitate modification of the software;
(3) . Manageable: Ability to combine functionality with data for ease of management;
(4). Loose coupling: reduces coupling and makes team development possible.
The above is "java object-oriented three characteristics are what" all the content of this article, thank you for reading! Hope to share the content to help everyone, more relevant knowledge, welcome to pay attention to the industry information channel!
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.