20,182,323 2019-2020-1 "data structures and object-oriented programming," the first four weeks learning summary

table of Contents

Student ID 20182323 2019-2020-1 "Object-oriented programming and data structures," the first four weeks learning summary

Learning content summary

  • 1. The relationship between objects and classes; (object class is a blueprint)
  • 2. appreciated state of the object (attributes) and behavior (operation);
  • 3. The method of allocating responsibility understood that construction of some classes and class;
  • 4. understand UML class diagram (Unified Modeling Language);
  • The public and private visibility modifier (public, private);
  • 6. Method understood definitions and method declarations;
  • Use 7.return statements;
  • 8. The static method call;
  • 9. The relationship between the classes (depending, polymerization, inheritance); (not yet mastered)
  • 10. A method of designing (decomposition method, parameter passing method); (not yet mastered)
  • 11. The method of overload (parameter type, a different number);
  • 12. Testing and debugging (jdb, print statements).

Textbook learning and problem-solving process

  • Question 1: member variables, local variables, the difference between static variable inadequate understanding.

  • Problem 1 Solution: access to online information that: The difference between them is shown in the table

  • Question 2: For the use of textbooks return statement is somewhat vague.

  • Problem 2 Solution: Combining data and reading textbooks last week, usage return statement is summarized as follows:

    1. the reserved word plus a return-expression, expression represents the value to be returned;

    2.return exit from the current process, return to the statement of the method of the call, continue;

    3.return return a value to the calling of this method statements, the return data type of the value must match the type declaration method return values;

    4.return behind can no arguments, no arguments that returns empty, in fact, the main purpose is to want to interrupt function is executed, returns to the calling function at.

  • Question 3: After reading a textbook on algorithms in pseudo-code, you want to deepen the understanding of pseudo-code.

  • Question 3 Solution: Find relevant information, are summarized as follows:

    1. The pseudo code of Chinese and English mixed composition, can be better expressed Algorithm

    2. In the pseudo-code, each instruction per line (else if, exceptions). Not with any symbol (Pascal and C statements should end with a semicolon) after the command. "Indent" indicates the branch structure of the program on the program writing;

Code debugging and problem solving in the process

  • Question 1: When Ubuntu terminal code to the code cloud git, display update was rejected because the remote repository contains your local submission does not yet exist.

  • Problem 1 Solution: The access to information that turned out to be before I submitted documents to the repository via the web. The solution is to enter the command git pull origin master --allow-unrelated- histories
    after this to local and remote warehouse warehouse merge conflicts, you can normally pleasant to use git push command you ~

Code hosting

Last week exam wrong question summary

  • Question 1: If a programmer writes a class wanting it to be extended by another programmer, then this programmer must (if a programmer to write a class that wants to be expanded to other programmers, then the programmer should?)

    A. Change private methods and instance data to be protected (examples of the private data and methods to protected type)

    B. Change public methods and instance data to be protected (examples of the public methods to protected data type)

    C. Change all methods to be protected (protected way to change all type)

    D. Change the class to be protected (protected changed to the class type)

    E. None of the above, the programmer does not have to change anything (no correct answer to the above, the programmer does not need to change anything)

  • Question 1 parse and understand: the correct answer A. I had to choose E. Declared as protected parts can be accessed by any subclasses defined their class, and declared as private can not be part of any other type of access. Therefore, private items previously defined must be protected. Previously defined public key should be kept, so that all other classes can still access these public items. It should not be defined before the private public, as this will allow them access to all classes, not just the subclass.

  • Question 2: Which of the following is true regarding Java classes? (About java class, Which of the following is true?)

    A. All classes MUST have have have have On May But the any parent. 1 Number of Children (Extended or derived)
    classes (All classes must have a parent, but can have unlimited subclasses)

    B. All classes must have 1 child (derived or extended) class but may have any number of parent classes (All classes must have a sub-class, but can have unlimited parent)

    C. All classes must have 1 parent class and may have a single child (derived or extended) class (All classes must have a parent class and a child class)

    D. All classes can have any number (0 or more) of parent classes and any number of children (derived or extended) classes (all classes may be any number of parent and child classes)

    E. All classes can have either 0 or 1 parent class and any number of children (derived or extended) classes (all classes have a parent or 0 and an infinite number of sub-class)

  • Question 2 parse and understand: choose the correct answer A, I was selected E. The teacher in the classroom when the only emphasis on this issue have a more profound understanding. object class is the ancestor of all classes, that is, all classes are derived from the object class. So the answer to the election A.

  • Question 3: A variable declared to be of one class can later reference an extended class of that class This variable is known as (a variable is declared as a class variable may be extended reference variable of this class is called. )

    A . protected

    B . derivable

    C . cloneable

    D . polymorphic

    E . none of the above, a variable declared to be of one class can never reference any other type of class, even an extended class

  • Question 3 parse and understand: choose the correct answer D, I was chosen is A. Was not learned polymorphism, see Inheritance protected keywords chapter decisively bite. In fact, multi-state variable representation can take many forms exist. In general, Java is forced defined as a variable, once declared as a certain type, you can never change it to a different type. The only exception is polymorphic variable may be any type of a derived class (although not at the same time, variables can also be converted from one type to another type).

  • Question 4: Using the reserved word, super, one can (with the reserved word super, able)

    A. Access a parent class'constructor (s) (access to the parent class constructor)

    B. Access a parent class'methods and instance data (access to the parent class methods and instance data)

    C. Access a child class'constructor (s) (sub-class constructor access)

    D. Access a child class'methods and instance data (access methods and instance data subclass)

    E. None of the above (not the correct option)

  • Question 4 parse and understand: the correct answer to choose E. A. I was selected A key point is this question and answer B is correct, it should be two answers to combine the job, then look at the answer to a hasty get away, not very careful, the future should pay attention to.

  • Question 5: Why should not an abstract method be declared final (Why should not an abstract method declared final it?)?

    A. There's nothing wrong with doing so (do it right)

    B. Abstract methods can not be overridden and they must be if a concrete class ever is to be instantiated (an abstract method can not be covered, they must be instantiated to a concrete class)

    C. So long as the Abstract method never actually is used in by any other method, there's no problem with doing this (as long as the abstract method has never been used in any other way to do this would be no problem)

    D. So long as the Abstract method is declared in a Class (not an Interface), there's nothing wrong with doing this (as long as the abstract methods declared in the class (instead of interfaces), then do it there is nothing wrong)

    E. None of the above (not the correct option)

  • 5 parse and understand the problem: the correct answer B, I had the option E, I do not know why I'm picking E. To be specific method abstract methods that must be covered. Declaring a method is final, let it not be overwritten. It is not.

  • Question 6: Interface classes can not be extended but classes that implement interfaces can be extended (interface class can not be extended, but the implementation of the interface class may be extended).

    A . true

    B . false

  • Question 6 parse and understand: the correct answer option B, then I chose A, belonging to the concept unclear. Any class can be extended, whether it is an interface, or implements an interface, or neither. The only exception is if the class is explicitly a "final" word was modified in such a case, it can not be extended

Pair peer review and

Comments template:

  • Worth learning problems or blog:
    • Add your own learning process images, impressive.
    • Analysis of the problem in place, there are in-depth study.
  • Code is worth learning or problem:
    • Code is more and more standardized layout, readability
    • Code appropriate to add comments will be better
  • Based on score, I give this blog scoring: 13 points. Scores are as follows:
  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 (2 points)

  4. The code debugging and problem solving process (2 points)

  5. Week over 300 branches valid code (plus 0)

  6. Other plus points:
    • Hair blog before Friday 1 point
    • Feelings, experience does not leave large empty 1 point
    • Progress bar records the learning time and improve the situation of 1 point
    • There are hands-on writing new code, add 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

Comments had students blog and code

Through self-study in-depth understanding of Java knowledge, combined with teaching materials, really understand the past did not understand, things rote.

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 77/77 2/2 15/15
The third week 424/501 3/5 30/30
the fourth week 393/894 2/7 30/30
  • Plan study time: 25 hours

  • The actual study time: 20 hours

  • Improvements: National Day pay close attention to make up for gaps

Reference material

Distinguish member variables, class variables, local variables

Java objects and classes

Guess you like

Origin www.cnblogs.com/caoqian1314/p/11614452.html