20172333 2017-2018-2 "Java Programming" 8th Week study Summary

Source: Internet
Author: User

20172333 2017-2018-2 "Java Programming" 8th Week study Summary Textbook Learning Content
    1. Polymorphic applications can point to different types of objects over time.
    2. For polymorphism applications, the method's reference is executed at run time with the binding of the method's definition code.
    3. Reference variables can specify any object of any class that has an inheritance relationship.
    4. The type of the calling method actually depends on the type of the object.
    5. The interface name can be used to declare an object reference object.
Problems in code debugging and the resolution process
    • [x] question 1: For PP9.5 writing process refers to the method of the root directory of the class, prompting the need to add a directory, but add the error still

    • Resolution: Idea Alt Enter still cannot correct the error after use, and eventually it is forced to move the class to the PP9.5 directory. problems in teaching materials learning and the solving process
    • [x] question 1: In the reading of the insertion method is understood as the latter number in comparison with the previous number and then according to the conditions of the swap position.
    • Solve the process: After the error, then go to Baidu related information to understand that the insertion method is actually after a number with the first few to compare after the selection of their position should be inserted again.

Code Hosting

(run result of statistics.sh script)

Last week's summary of the wrong quiz
    1. Which of the following statements is completely true?

A. If A class is declared to being abstract then every method in the class are abstract and must be overridden

B. If A class is declared to being abstract then some methods in the class could have their bodies omitted

C. If A class is declared to being abstract then all methods in the class must has their bodies omitted

D. If A class is declared to being abstract then all the instance variables must being overridden when a concrete class is derived From the abstract base class

Answer: B, I chose a.

Parsing: Abstract classes contain an abstract method, and not all methods must be abstract.

2.Can a program exhibit polymorphism if it is only implements early binding?

A. Yes, because one form of polymorphism is overloading

B. No, because without late binding polymorphism
Cannot be supported

C. Yes, because so long as the programs uses
Inheritance and/or interfaces it supports polymorphism

D. Yes, because early binding have nothing to do with polymorphism

E. None of the above

Answer: A, I chose D.

Parsing: Overloading of methods is the representation of polymorphism.

Comments:
    • Blogs that are worth learning or questions:

      Polymorphism implemented by inheritance
      Polymorphic references can point to different types of objects over time.
      For polymorphic references, the binding of the method call to the method definition code executes at run time.
      A reference variable can point to any object of any class that has an inheritance relationship.
      The version of the method that is actually called depends on the type of the object and not the type of the reference variable.
      The essence of polymorphism is that each class knows how to accomplish a specified behavior, and in a sense, each class behaves the same, and polymorphism allows a consistent but unique way to handle similar objects.
      Multi-port implementation of polymorphism using interfaces
      An interface name can declare an object reference variable.
      An interface reference variable can point to any object of any class that implements the interface.
      The parameters of the method can be polymorphic, making the parameters accepted by the method flexible.
      A sort algorithm that is implemented in a polymorphic manner can sort any set of objects that can be compared.
      Learn to use sorting and insertion methods.
      Polymorphism allows inconsistent behavior to be implemented in a consistent manner.
      Learn to use linear search and binary search.

The blog's description of the knowledge point is very detailed.

    • Something worth learning or doing in your code:
      The notes are organized and organized when you make Git commit.
reviewed the classmates blog and code
    • This week's study of the knot
      • 20172330 Linan
      • Pair of photos
      • Pairs of learning content
        • Rich commit content worth learning
        • The problem and the method of handling records are concise and clear.
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 125/125 2/2 20/20
Second week 269/394 2/4 Unknown/38
Third week 477/920 1/5 x/x
Week Four 1179/2338 1/6 --
Week Five 1131/3154 1/7 ? /?
Week Six 1448/4008 1/8 ? /??
Seventh Week 957/4840 2/10 ? /???
Eighth Week 1093/5933 2/10 ? /????
Other (sentiment, thinking, etc., optional) arithmetic good trouble. Resources

The polymorphism of Java

The insertion sort of Java classic sorting algorithm

20172333 2017-2018-2 "Java Programming" 8th 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.