34 years old! 100 days! Learning Java programming (Day12) -- link knowledge points, javaday12

Source: Internet
Author: User

34 years old! 100 days! Learning Java programming (Day12) -- link knowledge points, javaday12
Connection of knowledge points

In the previous development project, we mainly relied on the scattered knowledge points in "teach you how to learn Java" and used "Java from getting started to proficient" as a development dictionary for query. In the evening, the latter will be repeated from start to end to check for missing knowledge points. The main records are as follows:

Permission Modification Constant Modification Static Modification
Private, protected, public Final Static

Use Rules include:
(1) member variables and Methods Modified by private cannot be displayed and called by class objects or called by subclass objects. Similarly, the subclass method cannot override the parent class private method.
(2) member variables and Methods Modified by protected cannot be displayed and called by class objects, but can be called inside the quilt class objects.
(3) All the above permissions are granted to the public modified member variables and methods.
(4) The permission must be greater than or equal to the parent class of a subclass with the same name (no matter whether it is overwritten or overloaded.
(5) variables modified by final are constants. Methods Modified by final cannot be overwritten by quilt classes. Classes modified by final cannot be inherited.
(6) The variable modified by static is a global variable, which is created when the class is loaded. The method modified by static is a global method. Dynamic member variables and dynamic methods of the class cannot be called internally. static is not used to modify external classes, but can be used to modify internal classes. Static internal class creation objects do not require external class objects, and static internal classes can only access static external class variables and methods.
(7) syntax rules for static variables and members. For public static variables and methods, they are usually called directly (class name + static variable) and (class name + static method, instead of using objects + variables/methods (this method is feasible, but not recommended ).

  1. Basic Features of a class: encapsulation, inheritance, and polymorphism.
    (1) encapsulation is to protect member variables, but there are also static member variables that extend the use range of member variables.
    (2) inheritance was originally intended to reuse code, and later becauseTree StructureNot only is it easy for humans to understand, but it can also expand the cute feature of polymorphism.
    (3) to realize polymorphism, the core technology except tree structure must be used.Method Rewriting. For example, to compile a basketball program to allow a player to take a shot, you only need to use the primary method to call a player to take a shot, specific to the target backend, forward, and center on the sub-layer, the second-layer sub-objects Kobe, James, and o'neill have different performances in shooting. They only need to be used in specific sub-classes and sub-classes.Overwrite Shooting MethodYou only need to modify the primary method. If it is a traditional programming method, a large number of conditional branches need to be added to the main method.
    (4) note the following:Method RewritingAndMethod overload.
  2. Inheritance polymorphism, interface polymorphism, generics, reflection.
    (1) The core of inheritance polymorphism isMethod RewritingThey are different, but each method can reuse most of the Code by reusing the parent method;
    (2) The core of interface polymorphism isMethod implementationDifferent methods have different implementation processes because there is no reusable code between methods;
    (3) The core of generics isSame MethodThat is, the method code is the same, but the object types of method operations are different.
    (4) The core of reflection isIdentity AuthenticationAfter the above three technologies round the program, they will make an ID Identify trick to determine what type of object is running in the program. Well, I guess we can also create the same type of separation objects after the determination. If we play Six, we will not be inferior to Sun Wukong's dropping a handful of hairs, but we will be able to get out of ten thousand sons and grandchildren.
    11. Others: Swing, concurrency, TCP, and JDBC are all slightly reviewed.CE project V2.0When you think about it.
Join the study exchange group 569772982 to learn and exchange.


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.