search
HomeJavajavaTutorialWhat is object-oriented in java

What is object-oriented in java

May 27, 2019 pm 05:37 PM
java

Object-oriented

What is object-oriented in java

Object-oriented is relative to process-oriented

Object-oriented and process-oriented are both An idea

Process-oriented emphasizes functions and behaviors

Object-oriented: encapsulate functions into objects and emphasize objects with functions

Object-oriented is based on process-oriented The

process-oriented example:

Putting the elephant into the refrigerator is divided into the following steps: open the refrigerator door; put the elephant in; close the refrigerator door ( Emphasis on the process and the behaviors involved in the process (emphasis on behavior, action, process)).

Consider using object-oriented thinking: Whether it is opening the refrigerator, putting in the elephant, or closing the refrigerator, all operations are operating on the refrigerator object, so all functions only need to be defined on the refrigerator object. There are all the functions of opening, storing and closing.

As can be seen from the above, object-oriented is an idea that can simplify complex problems. Programmers do not need to understand the specific implementation process, but only need to direct the object to implement the function. For example, the interviewer interviews the interviewer, which is the embodiment of object-oriented. The interviewer needs to find an object (interviewer) with programming capabilities, and I am an object with programming capabilities. After the interview, let the interviewer program, and the interviewer will to implement programming functions.

Three basic characteristics of object-oriented: encapsulation, inheritance, and polymorphism. The object-oriented process is the process of finding objects, establishing objects, using objects, and maintaining relationships between objects.

1. Encapsulation
Hides the properties and implementation details of the object, and only provides public access to the outside world, isolating changes, making it easier to use, and improving reusability and security.
2. Inheritance
Improve code reusability; inheritance is the prerequisite for polymorphism.
3. Polymorphism
Reference variables defined by the parent class or interface can point to instance objects of the subclass or specific implementation class. Improved program scalability.

Category: It is a description of things in real life.

Object: It is this kind of thing, an individual that actually exists.

Such as the objects in real life: Zhang San and Li Si. If you want to describe the objects Zhang San and Li Si, you need to extract the common content in the objects. That is, the extraction of common features of specific objects. When describing, the common features of these objects are: name, gender, age, learning java function. And each student has his own unique name, gender, age, and learning style.

In Java, the description is implemented in the form of a class, and the class is implemented through the entity generated by the new operator, and this entity is mapped to Java in the heap memory. To put it simply, the description is the class defined by class, and the specific object is the entity created by Java using new in the heap memory.

Describing things is actually describing the attributes and behaviors (methods) of things. The attributes correspond to The variables and behaviors in the class correspond to the functions (methods) in the class. In fact, defining a class is describing things and defining attributes and behaviors. Attributes and behaviors together become members of the class (member variables and member methods).

The above is the detailed content of What is object-oriented in java. For more information, please follow other related articles on the PHP Chinese website!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
How do I use Maven or Gradle for advanced Java project management, build automation, and dependency resolution?How do I use Maven or Gradle for advanced Java project management, build automation, and dependency resolution?Mar 17, 2025 pm 05:46 PM

The article discusses using Maven and Gradle for Java project management, build automation, and dependency resolution, comparing their approaches and optimization strategies.

How do I create and use custom Java libraries (JAR files) with proper versioning and dependency management?How do I create and use custom Java libraries (JAR files) with proper versioning and dependency management?Mar 17, 2025 pm 05:45 PM

The article discusses creating and using custom Java libraries (JAR files) with proper versioning and dependency management, using tools like Maven and Gradle.

How do I implement multi-level caching in Java applications using libraries like Caffeine or Guava Cache?How do I implement multi-level caching in Java applications using libraries like Caffeine or Guava Cache?Mar 17, 2025 pm 05:44 PM

The article discusses implementing multi-level caching in Java using Caffeine and Guava Cache to enhance application performance. It covers setup, integration, and performance benefits, along with configuration and eviction policy management best pra

How can I use JPA (Java Persistence API) for object-relational mapping with advanced features like caching and lazy loading?How can I use JPA (Java Persistence API) for object-relational mapping with advanced features like caching and lazy loading?Mar 17, 2025 pm 05:43 PM

The article discusses using JPA for object-relational mapping with advanced features like caching and lazy loading. It covers setup, entity mapping, and best practices for optimizing performance while highlighting potential pitfalls.[159 characters]

How does Java's classloading mechanism work, including different classloaders and their delegation models?How does Java's classloading mechanism work, including different classloaders and their delegation models?Mar 17, 2025 pm 05:35 PM

Java's classloading involves loading, linking, and initializing classes using a hierarchical system with Bootstrap, Extension, and Application classloaders. The parent delegation model ensures core classes are loaded first, affecting custom class loa

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Chat Commands and How to Use Them
1 months agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

SublimeText3 Linux new version

SublimeText3 Linux new version

SublimeText3 Linux latest version

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment