Java abstraction, package, inheritance, and polymorphism understanding, java Polymorphism
1. abstraction, encapsulation, assembly, inheritance, and polymorphism are several major features of java object-oriented programming.
Abstraction: Abstraction refers to a transaction. We ignore what we don't care about, extract the attributes and actions we want, and extract them as code; for example, we need to abstract a student. We only care about his score, so we do not care about his height. We do not care whether the student eats with his left hand, we only care about whether or not he performs the test, so we only need to extract the score attributes and test behavior.
Encapsulation: Abstract behaviors and attributes must be saved together, and can be encapsulated as a class to provide external access interfaces.
Inheritance: inheritance can make the program more flexible and make the code more concise. Subclass inherits the parent class and can have the attributes and methods of the parent class. The parent class extracts the common attributes of the Child class.
Polymorphism: multiple states are displayed, and multiple selectivity is added. class inheritance is the medium withdrawal of polymorphism, and the method overload is also the medium withdrawal of polymorphism.