Object-orientedProgramThe design consists of six concepts:
1. Class: it is the basic structure of every Java program. It contains data domains and data operation mechanisms. The class provides templates for creating these software objects.
2. Object: an object is an instance created using a class as a template and can be used to generate any number of objects.
3. encapsulation: Allows or disables the functions of data and member methods of a category or object.
4. Overloading: A member method can have multiple definitions. Different definitions can be selected based on different requirements.
5. Inheritance: Obtain the features that the relevant class already has.
6. Polymorphism: the ability to process multiple correlated classes based on common features and call methods of different classes according to different environments.
Defining a class can be divided into three parts:
1. Is: indicates the class "what", that is, the class name and its nature, such as the parent class and modifier of A Class. This part is called the class declaration.
2. Has: Describes the "what" features and attributes of this class. These features and attributes are represented by domain variables, which are called member variables.
3. Does: describes what the class can "do", that is, the behaviors of the class. These behaviors are described by instance methods and class methods. These methods are collectively referred to as member methods.
The is and has constitute the status of a class, and does is the behavior of a class.