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

20,182,331 2019-2020-1 "data structures and object-oriented programming," the first week of learning summary

Learning content summary

  1. for statement: Oh yo generally known case where the number of cycles
    for-each: simplifying the processing elements in the object Iterable
  2. Analysis of the class
    instance data: class attributes
    UML class diagram: visualization of the programming language modeling described
  3. Package
    visibility modifiers: public, private, protected
    accessor and modifier: providing services to access and modify data values instance
  4. Analysis of
    the return statement: seeking the return value

Textbook learning and problem-solving process

  • Question 1: For the ArrayList class still did not understand, do not know the specific usage
  • Problem 1 Solution: Internet search, I found a blog, it is ArrayList are summarized. Here is the blog link
    http://www.cnblogs.com/YSO1983/archive/2011/08/22/2149711.html
  • Question 2: What is the authority modifier, what does it do, why you need it
  • Problem 2 Solution: a Java application there are a lot of classes, but some classes do not want to be other classes. Each class has data members and member methods, but not every data and methods, are allowed to call in other classes. How access control can do it? We need to use access modifier

Code debugging and problem solving in the process

  • Question 1: I entered n is 2 (allows the user to enter two values) but the user can output the three values, so we stuck in there.

  • Problem 1 Solution: I later found the for loop judge sentences a problem. So it should be <replace <=.
  • Question 2: Programming in making people have been unable to run
  • Problem 2 Solution: Multi-hit a brace, resulting not find the main class

Code hosting

Last week exam wrong question summary

IF you DECLARE A happens 1.What class constructor to have have void return of the type A?
A. LIKELY by You'll receive A syntax error
B. By Will at The Program with the compile A warning, But you'll GET A Runtime error
C. There's Nothing Wrong Declaring a constructor to bE with void
D at the class' default constructor by will bE Used INSTEAD of you're Declaring at the One.
Analysis: declare any type of constructor is even void is a violation of syntax, so you will receive a syntax error.

Whose IS Restricted variable scope 2.A to Method The WHERE IT IS Known declared WAS AS A (n-)
A Parameter.
B Global variable.
C local variable.
D Data public instance.
E Private Data instance.
Analysis: those local variables are declared "local" variables of their method, that is, they can only be accessed inside the method. Global variables are variables that can be accessed from anywhere, and the parameter is passed into the method variables. Examples of data can be seen as a global variable entire object.

On May Contain A return constructor 3.A Statement SO AS NO Long value (or expression The) IS returned.
A to true.
B to false.
Analysis: constructor can comprise a non-return values return statement.

To preserve encapsulation of the Order 4.In AN Object, WE Would do at The following All of the except for Which One?
A. Instance the Make the Data at The Private
B. At The class in the Define at The Methods to Access and Manipulate the Data at The instance
C. The Make at The Methods the public class of
D class the Make the Final.
Analysis: encapsulation means and method class contains data required for the operation data. In order to properly retain the package, instance data should not be accessed directly from outside the class, instance data is private, and define methods to access and manipulate data instance. Further, access data instance and method of operation are disclosed, so that other classes can use the object. Reserved word "final" for controlling inheritance, regardless of the package.

The class of Multiple Methods 5.Having Same each name WHERE has Method A or type of Different Parameters Number of Known IS AS
A encapsulation.
B Information Hiding.
C tokenizing.
D Importing.
Analysis: When the process of sharing the same names, which are called overloading. Number and type of arguments passed in the message provide information to invoke the correct method.

  1. Of The Expressions that are passed to A Method in AN Invocation are Called
    A Actual Parameters.
    B Formal Parameters.
    C Formal arguments.
    D formals.
    Analysis: form (formal parameters, formal parameters) are in the form of a statement in the header of a method. Actual parameter (actual value, the actual parameter) expression is actually passed to the method in the call.
    Summary: In fact, I enumerated the problems just learning this week, some of the typical thinking of the wrong type, some errors on the basics of points I did not set out, knowledge or mistakes too.

    Pair peer review and

  • Worth learning problems or blog:
    • Learn deep, they have a method
    • Code is worth learning or problem:
    • Reduce the use of inheritance rewriting the code
    • Based on score, I give this blog Rate: 8 points. Scores are as follows:
    • Proper use Markdown syntax (1 point)
    • Elements range (1 point template
    • Textbook learning and problem solving process, a problem 1 point
    • Code debugging and problem solving in the process, a problem 1 point
    • Typesetting fine plus one point
    • Code Commit Message Specification 1 point
    • There are hands-on writing new code, add 1 point
    • Pair learning authentic plus 1 point

Comments had students blog and code

  • Pair this week learning
  • 20182309
    • Pair learning content
    • IDEA learning operation
    • Quickly generate class
    • Integrated Development
    • Use IDEA fast processing error

Learning progress bar

The number of lines of code (add / accumulate) Blog amount (add / accumulate) Learning time (add / accumulate) Important growth
aims 5000 rows 30 400 hours
the first week 204/1027 2/6 22/89

Reference material

Guess you like

Origin www.cnblogs.com/gao-kuanrang/p/11612592.html