Home  >  Article  >  Java  >  What is the relationship between classes and objects

What is the relationship between classes and objects

王林
王林Original
2020-07-01 13:52:2432659browse

The relationship between classes and objects is: the relationship between classes and objects is abstract and concrete. A class is a template, an abstract description of a type of thing; an object is used to represent the individual of that thing in reality. A class is an abstraction on top of an object, and an object is the concretization of the class and an instance of the class.

What is the relationship between classes and objects

#What is the relationship between classes and objects?

(Recommended learning: Introduction to java development)

There is an abstract and concrete relationship between classes and objects. A class is a template, an abstract description of a type of thing, and an object is used to represent the individual of that thing in reality. A class is an abstraction on top of an object, and an object is the concretization of the class and an instance of the class.

A class must be used through an object, and the properties and behaviors in the object must be defined in the class.

What is an object?

Object (Object) is an entity used to describe objective things in an application system. It is a basic operating unit with specific attributes and behaviors (methods). Is an instance of a special state of a class. An object can be an entity, a noun, anything that can be imagined as having its own identity. In a nutshell: everything is an object.

(Video tutorial recommendation: java video tutorial)

What is a class?

Class (Class) is the basic organizational module of Java code, used to describe a set of basic prototypes of objects with common attributes and behaviors. It is a generalization, induction and descriptive expression of this group of objects. A class is a template for an object. It defines the set of properties and behaviors owned by objects of this class. It is the definition of a group of objects with the same properties and the same methods.

The above is the detailed content of What is the relationship between classes and objects. 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