20172320 2017-2018-2 "Java Programming" Eighth Week study summary

Source: Internet
Author: User

20172320 2017-2018-2 "Java program design" Eighth Week study summary textbook study summary

1, binding in most cases occurs in the compilation phase
2. Deferred request events become post-bound or dynamically bound, and post-binding efficiency is lower than the binding efficiency of the compile phase
3. Polymorphism references: Inheritance mode and interface mode
4. A reference variable can point to any object of any class that has an inheritance relationship
5. The actual method version that will be called depends on the type of the object and not the type of the reference variable
6. An interface reference variable can point to any object of any class that implements the interface
7. The selection method is sorted by successively placing each value in its final position, the insertion order is constantly inserting a new element into the sorted subset until the entire sequence is sorted.

8. The two sorts are n^2-order algorithms, but the number of switching operations performed by the Select sort is less, so the selection method is better than the insertion method
9. Linear search starts with a single endpoint and scans the entire search pool in a linear fashion; a binary search starts from the midpoint of an ordered series

10, if the long-term search efficiency is not an important issue, linear search may be the best choice

Problems in teaching materials learning and the solving process
    • Question 1: Comparison of two kinds of sorting methods
    • Problem 1 Solution: The book says that the number of switching operations selected for sorting is less, so better than the insertion method. But since the existence of this arrangement, then there must be its advantages, in the online search, compared with several permutations, found that it is relative to several other methods have 稳定,快 advantages, but not suitable for the large amount of data

      At the same time, the comparison formula of efficiency of these two sorting methods is also found out.

      It can be seen that the more orderly the sequence, the less the number of comparisons required to insert the sort, and the choice of sort comparisons to N (N-1)/2, thus further explaining that the insertion arrangement is not suitable for handling large, cluttered data
Problems in code debugging and the resolution process
    • Problem 1:pp10.5 cannot be sorted
    • Problem 1 Solution: Just start directly to the eighth chapter of the DVD and movie copied over in the movie to modify, the results can not be sorted, and then simply useless CompareTo method, on the DVD in the copy after the contact CompareTo to define, and then there is this problem


      The comparable interface was not used on the DVD.
Code Hosting

Last week's summary of the wrong quiz
  • All classes in Java is 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, it extends the object class by default. The object class is the parent class of other classes in Java.

  • In order to determine the type of a polymorphic variable refers to, the decision is made
    A. By the programmer at the time of the program is written
    B. By the compiler at compile time
    C. By the operating system, the program was loaded into memory
    D. By the Java run-time environment at run time
    E. By the user at run time
    Analysis: polymorphic variables can contain many different types, but before the program executes, it does not know which type. When you reference a variable, you must make a decision. This decision is made by the runtime environment based on the latest allocation 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 the parent class's methods and instance data, whether or not they are hidden. In addition, you can use super to access the constructor of the parent class.

    Pairing and mutual evaluation
reviewed the classmates blog and code
    • This week's study of the knot
      20172327
      20172317
    • Pairs of learning content
      The 10th chapter of the textbook
      ? Read Section 10.1-10.6
      To complete the self-test after class, and refer to the answer study
      Finish the exercises after class.
      Complete programming Project: At least complete PP10.1, PP10.4, PP10.5.
Learning progress Bar
lines of code (new/cumulative) Blog Volume (Add/accumulate) Learning Time (new/cumulative) Important Growth
Goal 5000 rows 30 Articles 400 hours
First week 67/67 1/4 20/20
Second week 328/395 1/5 20/40
Third week 523/851 1/6 20/60
Week Four 1070/1921 1/7 20/80
Week Five 608/2529 1/8 10/90
Week Six 608/2899 1/9 20/110
Seventh Week 429/3328 1/10 20/130
Eighth Week 804/4131 1/11 20/150
Resources
    • Java Programming and Data Structure Tutorial (eighth edition)
    • Blue Ink Cloud Class class
    • The pros and cons of several sorting methods in Java
    • Comparison of Insert sort and select sort

20172320 2017-2018-2 "Java Programming" Eighth Week study summary

Related Article

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.