20165210 Java Fourth Week study summary

Source: Internet
Author: User

20165210 Java Fourth Week study summary textbook learning content
    • Fifth Chapter Study Summary
    1. Subclass and Parent class:
    • Sub-class:

      class 子类名 extends 父类名 {...}
    • The tree structure of the class
    1. 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
    1. Subclasses and objects
    • Characteristics of sub-class objects
    • About the instanceof operator
    1. 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
    1. Super keyword
    • Methods for manipulating hidden member variables with super
    • To call the constructor of a parent class using super
    1. Final keyword
    • Final class

      final class A {...}
    • Final method
    • Constant
    1. Objects on top of a transition object

      Animal a;a = new Tiger();或Animal a;Tiger b=new Tiger();a = b;
    2. Inheritance and polymorphism
    3. Abstract class and abstract method

      abstract class A {...}
    • Sixth Chapter Study Summary
    1. Interface:

      interface Printable {final int MAX=100;viod add();float sum(float x ,float y);}
    2. Implementing the interface:
    • Class implementation Interface
    • Overriding methods in an interface
    • Detail description of the interface
    1. UML Diagrams for interfaces
    2. Interface callbacks
    3. Understanding Interfaces
    4. Interface and polymorphism
    5. Interface parameters
    6. 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.
    1. 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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.