20165210 Java Fourth Week study summary textbook learning content
- Fifth Chapter Study Summary
- Subclass and Parent class:
- Inheritance of subclasses:
- Inheritance of subclasses and parent classes in the same package
- Inheritance of subclasses and parent classes that are not in the same package
- UML Diagrams for inheritance relationships
- Further explanation of protected
- Subclasses and objects
- Characteristics of sub-class objects
- About the instanceof operator
- Hidden method overrides for member variables
- The hiding of member variables:
A member variable that has the same name as the parent class of a subclass object and a subclass of its own definition of a method operation refers to this member variable that the subclass is re-declared.
A subclass object can still invoke a method inherited from a parent class to manipulate a member variable that is hidden by the quilt class, that is, the member variable that the child class inherits from a method that operates on a member variable that is inherited or hidden by the quilt class.
- Method overrides:
Syntax rules for overriding
Purpose of rewriting
- Super keyword
- Methods for manipulating hidden member variables with super
- To call the constructor of a parent class using super
- Final keyword
-
Final class
final class A {...}
- Final method
- Constant
-
Objects on top of a transition object
Animal a;a = new Tiger();或Animal a;Tiger b=new Tiger();a = b;
- Inheritance and polymorphism
-
Abstract class and abstract method
abstract class A {...}
- Sixth Chapter Study Summary
-
Interface:
interface Printable {final int MAX=100;viod add();float sum(float x ,float y);}
- Implementing the interface:
- Class implementation Interface
- Overriding methods in an interface
- Detail description of the interface
- UML Diagrams for interfaces
- Interface callbacks
- Understanding Interfaces
- Interface and polymorphism
- Interface parameters
- Comparison of abstract classes and interfaces
- The abstract classes and interfaces are compared as follows:
Abstract classes and interfaces can have an abstract method
There can be only constants in an interface, no variables, and there can be constants or variables in an abstract class
Abstract classes can also have non-abstract methods, interfaces are not available.
-
Interface-Oriented Programming
Code Hosting
Sentiment
This week's code is still more, and the content is more difficult, the interface is also difficult to learn
20165210 Java Fourth Week study summary