# 20182335 2019-2020-1 "Object-oriented programming and data structures," the sixth week of learning summary

Learning content summary

Chapter nine

1, after binding: polymorphic reference may be to different types of objects at different times, when the operating method call with its definition tied together;

2, through inheritance polymorphism: the reference variable may be directed to declare any object inherits its class;

3: Interface level, Comparable interfaces, Iterator interfaces;

4, polymorphism through interface: Event handling

chapter Ten

1. exception handling.

2.try-catch statement.

3.finally statement.

Class 4 on exceptions and their level.

The difference will be seized and contact abnormalities and abnormal exemption.

6.I / O abnormal.

Textbook learning and problem-solving process

  • Question 1: For the meaning and usage of comparable interface do not understand.
  • Problem 1 Solution: Check the Internet blog, by what is comparable to the interface? What method to achieve?
    As well as examples, have a certain understanding of comparable interface.
  • Question 2: Do not catch the exception, a reference to the call stack trace of the concept. What is not clear is the stack trace.
  • Problem 2 Solution: the textbooks say, the first line of first throw an exception and give the reason, the rest of the line is the call stack trace, is to point out where the exception occurred. Stack trace indicates the location of the exception, and put the call out unusual position display. I read a blog post about Java exception, which refers to the stack trace elements, it helps to understand the concept.

Code debugging and problem solving in the process

  • Question 1: Question 1, consistent with the book because the code will not compile count
  • Problem 1 Solution: count deleted.
  • Question 2: 10.1 procedures, follow the tutorial enter the code, the results are different with the book output. There are only printed result of the first row, but showed no abnormality occurring following code directly ends.
  • Problem 2 Solution: Try changing the code.

Code hosting

Last week exam wrong question summary

  • 错题1:Both the Insertion Sort and the Selection Sort algorithms have efficiencies on the order of ________ where n is the number of values in the array being sorted.

A .n

B .n * log n

==C== .n^2

D .n^3

E .Insertion sort has an efficiency of n and Selection Sort has an efficiency of n^2

Analysis: two kinds of sorting algorithms use two nested loops, each loop is executed about n times, which brings to both N * N complex or N ^ 2.

错题2:Polymorphism is achieved by

A .overloading

==B== .overriding

C .embedding

D .abstraction

E .encapsulation

Analysis: Overloaded only provides an alternative method is a method with different parameter lists. Rewrite provide polymorphism, because the call to the appropriate method based on the object currently being referenced. Closure is fitted within the class category. Abstract and unrelated polymorphisms. Use visibility modifier (public, private, protected) to achieve encapsulation.

  • 错题3:We compare sorting algorithms by examining

==A== .the number of instructions executed by the sorting algorithm

B .the number of instructions in the algorithm itself (its length)

C .the types of loops used in the sorting algorithm

D .the amount of memory space required by the algorithm

E .whether the resulting array is completely sorted or
only partially sorted

Different sorting algorithms require a different number of instructions that when executed. For example, selection sort generally require more instructions than the insertion sort. Therefore, we will sort by the number of instructions required to execute the algorithm to sort the array for comparison. We can calculate the maximum number of instructions executed ranking algorithm in the worst case, or the minimum number of best case, or the average number of instruction execution. If the two sorting algorithms require roughly the same number of instructions to sort the array, we can also check the amount of memory space required.

错题4:Can a program exhibit polymorphism if it 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 has nothing to do with polymorphism

E .none of the above

Analysis: Although the interface supports inheritance and polymorphism, but they only have it in the case of polymorphism support late binding. However, a heavy load polymorphic form, a (method) name, as long as the program uses multiple individual overloading, polymorphism in use.

Pair peer review and

Grading

  1. Proper use Markdown syntax (1 point):
    • Do not use Markdown no extra points
    • A syntax error is not a plus (link does not work, does not form, the list is incorrect ...)
    • Typesetting confusion is not a plus
  2. Elements range (1 point) template
    • Missing "textbook learning and problem solving process" without points
    • Lack of "problem solving and debugging code in the process" without points
    • Managed code can not be opened without points
    • Missing "twinning and peer assessment" can not be opened without points
    • Missing "last week summed up the wrong title examination" can not be a plus
    • The lack of "progress bar" can not be a plus
    • Lack of "reference" can not be a plus
  3. Textbook learning and problem solving process, a problem 1 point

  4. Code debugging and problem solving in the process, a problem 1 point

  5. Week over 300 branches valid code (plus 2 points)
    • Submitted one week fewer than 20 times without points
  6. Other plus points:
    • Hair blog before Friday 1 point
    • Feelings, experience does not leave large empty 1 point
    • Typesetting fine plus one point
    • Progress bar records the learning time and improve the situation of 1 point
    • There are hands-on writing new code, add 1 point
    • After class choice has verified 1 point
    • Code Commit Message Specification 1 point
    • Learning the wrong questions in depth, add 1 point
    • Comments seriously, I can point out problems and blog code plus 1 point
    • Pair learning authentic plus 1 point
  7. Points:
    • Plagiarism buckle to 0
    • Cheat codes to buckle 0
    • Late assignments to buckle 0

Comment:

Comments had students blog and code:

20182311

Other (perception, thinking, etc., optional)

Learning a lot this week, combined with textbooks and class network video, I feel like I'm part of this knowledge is not very understanding also s understanding, and some learning task is not well done for the early completion. Learning this kind of thing can not drag, and the need for timely to review each test I feel a lot of content does not seem to have seen the wrong questions will be more, after learning or more to review the main information for the teacher to learn it helpful, but also seriously. This week, as always, things still more, even after learning refueling efforts. Continue efforts to stay focused.

Learning progress bar

The number of lines of code (add / accumulate) Blog amount (add / accumulate) Learning time (add / accumulate) Important growth
aims 10,000 lines 30 400 hours
the first week 200/200 2/2 20/20
the second week 300/500 2/4 18/38
The third week 500/1000 3/7 22/60
the fourth week 325/500 2/4 18/38
fifth week 600/1000 3/7 22/60
Sixth Week 300/1000 3/7 18/38

Reference material

Guess you like

Origin www.cnblogs.com/lijinquan/p/11681688.html