What is class? What is the object

What is the class

Class: is a group of related properties and behavior of the collection. It can be seen as a kind of template of things, use things attribute characteristics and behavioral characteristics to describe this kind of things.

Example: kittens.

 

Attributes: name, weight, age, color. Behavior: walking, running, called.

 

What is the object

A concrete manifestation of the class to achieve.

 

For example: a kitten.

 

Properties: tom, 5kg, 2 years, yellow. Behavior: slip foot of the wall walk, jumping tap running, meow.

 

The relationship between classes and objects

 

Class is a description of a class of things, is the abstract of.

 

Objects are instances of a class of things, are specific to.

 

Class is an object template, the object is the type of entity.

 

The object is based on the class to create, like in what objects have what

 

Guess you like

Origin www.cnblogs.com/libinhong/p/10988808.html