20172320 2017-2018-2 "Java Programming" Eighth Week Learning Summary

20172320 2017-2018-2 "Java Programming" Eighth Week Learning Summary

Textbook learning content summary

1. Binding occurs in the compilation phase in most cases.
2. The delayed request event becomes post-binding or dynamic binding. The efficiency of post-binding is lower than the binding efficiency in the compilation phase.
3. Polymorphism reference: inheritance and Interface method
4. A reference variable can point to any object of any class that has an inheritance relationship.
5. The actual version of the method that will be called depends on the type of the object, not the type of the reference variable.
6. An interface reference variable can point to any object that implements the interface. Any object of the class
7. Selection sort By successively placing each value in its final position, insertion sort is to continuously insert a new element into a subset of the already arranged sequence until the entire sequence is ordered.

8. Both sorts are n^2-order algorithms, but the selection sort performs fewer swap operations, so the selection method is better than the insertion method.
9. Linear search starts from an endpoint and scans the entire search pool in a linear fashion; Binary search starts from the midpoint of the ordinal sequence

10. If the efficiency of the search is not an important issue in the long run, linear search may be the best choice

Problems and Solving Processes in Teaching Materials Learning

  • Question 1: Comparison of two sorting methods
  • Solution to problem 1: The book says that the number of exchange operations for selection sorting is less, so it is better than the insertion method. But since this arrangement method exists, it must have its advantages. I searched on the Internet, compared several arrangement methods, and found that it has 稳定,快advantages over other methods at the same time, but it is not suitable for a huge amount of data.

    At the same time, the comparison formulas of the efficiency of these two sorting methods are also found. It

    can be seen that the more ordered the sequence, the less the number of comparisons required for insertion sorting; and the number of comparisons for selection sorting is always N*(N-1)/2 times, so Further explain that the insertion permutation method is not suitable for processing large and messy data

Problems and solutions in code debugging

  • Problem 1: PP10.5 cannot sort
  • Solution to problem 1: At the beginning, I copied the DVD and movie of Chapter 8 directly and modified them in the movie, but the results could not be sorted. Later, the compareTo method was not used at all, so I defined the compareTo in the DVD after the Contact, and then there are as follows: Figure this problem


    , a careful comparison found that the Comparable interface is not used in the DVD

code hosting

Summary of last week's exam mistakes

  • All classes in Java are directly or indirectly subclasses of the ________ class.
    A .Wrapper
    B .String
    C .Reference
    D .this
    E .Object
    Analysis: Java requires that all classes have a parent class. If a class does not extend another class then it extends the object class by default. Object class is the parent class of other classes in Java.

  • In order to determine the type that a polymorphic variable refers to, the decision is made
    A .by the programmer at the time the program is written
    B .by the compiler at compile time
    C .by the operating system when the program is loaded into memory
    D.by the Java run-time environment at run time
    E.by the user at run time
    Analysis: A polymorphic variable can contain many different types, but it doesn't know which type it is until the program executes. When referencing variables, decisions must be made. This decision is made by the runtime environment based on the latest assignment of variables.

  • Using the reserved word, super, one can
    A .access a parent class'constructor(s)
    B .access a parent class'methods and instance data
    C .access a child class'constructor(s)
    D .access a child class'methods and instance data
    E .none of the above
    analysis: Super reserved words provide a mechanism for accessing methods and instance data of the parent class (whether they are hidden or not). Also, super can be used to access the constructor of the parent class.

    Pairing and mutual evaluation

Reviewed classmates blog and code

  • This week's paired learning situation
    20172327
    20172317
  • Pair learning content
    ◦Chapter 10 of the textbook
    ◦Read chapters 10.1-10.6 ◦Complete
    the after-school self-assessment questions, and learn with reference to the answers ◦Complete the
    after-school exercises
    ◦Complete programming projects: at least complete PP10.1, PP10.4, PP10. 5.

learning progress bar

Lines of code (added/accumulated) Blog volume (new/cumulative) Study time (added/accumulated) important growth
Target 5000 lines 30 articles 400 hours
the first week 67/67 1/4 20/20
the second week 328/395 1/5 20/40
The third week 523/851 1/6 20/60
the fourth week 1070/1921 1/7 20/80
fifth week 608/2529 1/8 10/90
Week 6 608/2899 1/9 20/110
Week 7 429/3328 1/10 20/130
eighth week 804/4131 1/11 20/150

References

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325214454&siteId=291194637