# 20182333 2019-2020-1 "data structures and object-oriented programming," the second and third week learning summary

20,182,333 2019-2020-1 "data structures and object-oriented programming," the second and third week learning summary

Learning content summary

Chapter two

  • 1. The concept of string and stitching.
  • Usage and differences 2.println method and print method
  • 3. The concept and usage escape sequences.
  • 4. constants and variables related to the content of the assignment statement.
  • 5.8 basic data types.
  • 6. The concept of the expression, arithmetic, increment decrement, assignment operators, and three kinds of operator precedence.
  • 7. The security and data type conversion of the three technologies.
  • Application 8.Scanner class.

third chapter

  • 1. Create an object, object reference variable declaration and initialization, alias.
  • 2.String important application category.
  • 3. The concept of packages.
  • The role of 4.import statement.
  • 5.Random class and use the Math class.
  • 6. The two types of formatted information: NumberFormat DecimalFormat classes and classes.
  • The role of 7.printf methods.
  • 8. Special classes: Enumeration.
  • 9. The concept and the use of packaging.

Textbook learning and problem-solving process

Chapter two

  • Question 1: The difference between Java in the print and println.
  • Problems Solution 1: println output method after the cursor will change to the next line, and the print output will not be re-wrapped to the next line.
  • Question 2: distinguishing string of digital computing and digital mosaic.
  • Problem 2 Solution: If there is at least a digital mosaic is a string, come in two forms: 1. The figures in the string, which is double quotes. (Code form: "Letters in the Hawaiian alphabet: 12"). 2 + numeric string + number or string. (Code form: "Speed ​​of ketchup:" + 40 or 40+ "km per year"). If the digital arithmetic operands are numeric, i.e. the number + number in parentheses. (Code form: "24 and 45 added:" + (24 + 45)).
  • Question 3: operator priority
  • Question 3 Solution:

  • Question 4: What is a string constant?
  • Problems Solution 4: string constant is a sequence of characters in double quotes.
  • Question 5: escape character
  • Question 5 Solution: escape character is a backslash () at the beginning of a string of characters that represents the back of the character in a special way.
  • Question 6: Why should avoid the use of narrowing conversion?
  • Question 6 Solution: narrowing conversion, the conversion is from a smaller footprint data values ​​for the data values ​​occupy a larger space. The narrowing conversion and vice versa. In narrowing conversion, the data is likely to be lost, which is why the reasons to avoid narrowing conversion.

third chapter

  • Question 1 :: For the class, the concept of objects, variables confusion.
  • Problem 1 Solution:
1.对象的概念:万物皆对象,客观存在的事物皆为对象。
2.什么是面向对象:人关注一个对象,实际上是关注该对象的事务信息。
3.类:类是模子,确定对象将会拥有的特征(属性)和行为(方法)。类的特点:类是对象的类型,具有相同属性和方法的一组对象的集合
4。什么是对象的属性:属性,对象具有的各种特征 ,每个对象的每个属性都拥有特定值
5.什么事对象的方法:对象执行的操作
6.类与对象方法,属性的联系和区别:类是一个抽象的概念,仅仅是模板,比如:“手机”对象是一个你能够看得到,摸得着的具体实体
如何定义Java中的类:
  1.类的重要性:所有Java程序都以类class为组织单元
  2.什么是类:类是模子,确定对象将会拥有的特征(属性)和行为(方法)
  3.类的组成:属性和方法
  4.定义一个类的步骤:
     a.定义类名
     b.编写类的属性
     c.编写类的方法
  • Problems 2: String class methods commonly used
  • Problem 2 Solution:

  • Application of Random class: Question 3
  • Question 3 Solution:

  • Application Math class: Question 4
  • Question 4 Solution:

  • Question 5: What is the new operator to perform the operation?
  • Problems Solution 5: new operator to create a new instance of a specified class (object), and then calls the constructor provided new object class is generated.
  • Question 6: What is a null reference?
  • Question 6 Solutions: null references do not point to any object. With the reserved word null null reference checks, to prevent access to the null reference.

Code debugging and problem solving in the process

  • Question 1: After the output is not line breaks.

  • Question 1 solution: the program will printbe changed printlnto.
  • Question 2:

  • Problem 2 Solution: printlnmissing lost t, a little careless.
  • Question 3: classes and packages do not.

  • Question 3 Solution: random类corresponds java.util程序包.
  • Question 4:
  • Question 4 Solution: guilty or careless mistake. The formatm and a write-down.
  • Question 5:

  • Question 5 Solution: because there is no formatted output. In the beginning of the program package input import java.text.*;inputted in the program after DecimalFormat fmt = new DecimalFormat ("0.####");the output is + fmt.format(X)on it.

Code hosting

Last week exam wrong question summary

  • Which memory capacity is the largest? (Maximum storage capacity which option?)

    A .1,500,000,000,000 bytes (1,500,000,000,000 bytes)

    B .100 gigabytes (100 gigabytes)

    C .3,500,000 kilobytes (3,500,000 kilobytes)

    D .10 terabyte (10 terabytes)

    E .12,000,000 megabytes (12,000,000 MB)

    The answer is E, I chose D. Analysis: byte units not understand, terabyte is equal to tb, gigabyte is equal to gb. D is 10tb, E is 12tb, greater than D.
  • Volatility is a property of (___ nature of variability)

    A .RAM (Random Access Memory)

    B .ROM (Read Only Memory)

    C .disk (disk)

    D .software (software)

    E .computer networks (computer networks)

    The answer is A, I chose D.
  • 3.The ability to directly obtain a stored item by referencing its address is known as (get the ability to store items directly by reference address is called ___)

    A. Random access (random access)

    B. Sequential access (sequential access)

    C. Read-only access (read-only access)

    D. Fetch access (to gain access)

    . E volatility (volatility)
    Analysis: direct access is a random access.
  • Java is an example of a (n) (Java is an example of a ___)

    A .machine language (machine language)

    B .assembly language (assembly language)

    C .high-level language (high level language)

    D .fourth generation language (fourth generation language)

    E .both C and D (C and D are)
    the answer is E, I chose C. Analysis: The book just said Java is a high-level language, but he is also a fourth generation language.
  • A Java program is best classified as (a Java program is classified as most suitable ___)

    A. Hardware (hardware)

    B. Software (software)

    C. Storage (storage)

    D. Processor (processor)

    E. Input (input)

    Analysis: The program is classified as software, as distinct from the mechanism of the computer (hardware). The processor and memory are two forms of hardware, a program information input processing.
  • Java byte codes are directly executable whereas Java source code is not. (Java bytecodes can be executed directly, and the Java source code is not.)

    A . true

    B . false

    Parsing: Java source code and Java byte code is not executable. Both must be compiled or interpreted into machine code. Java bytecodes are useful, but they are machine independent, semi-compiled code, which allows Java code to transmission through the Internet and run on another computer, even if other types of computers are completely different.
  • Which of the following is true regarding Java syntax and semantics? (About Java syntax and semantics, which of the following is true?)

    A. A Java compiler can determine if you have followed proper syntax but not proper semantics (Java compiler can determine whether you follow the correct syntax, but can not determine the correct semantics)

    B. A Java compiler can determine if you have followed proper semantics but not proper syntax (Java compiler can determine whether you follow the correct semantics, but can not determine the correct syntax)

    C. A Java compiler can determine if you have followed both proper syntax and semantics (Java compiler can determine whether you follow the correct semantics and syntax)

    D. A Java compiler can not determine if you have followed either proper syntax or semantics (Java compiler can not determine whether you follow the correct syntax or semantics)

    E. A Java compiler can determine if you have followed proper syntax and can determine if you have followed proper semantics if you follow the Java naming convention rules (if you follow the Java naming convention, Java compiler can determine whether you follow the correct grammar, and it can determine whether you follow the correct semantics)

    The answer is A, I chose E. Analysis: All language compiler can detect syntax errors, because improper use of syntax causes the compiler can not correctly translate the code of circumstances. However, the compiler can not follow the semantics of the program, because it requires a certain level of understanding of what the program intends to do, but the computer does not understand
  • Consider the following statement:
    System.out.println("1 big bad wolf\t8 the 3 little pigs\n4 dinner\r2night");

    This statement will output ________ lines of text (consider the following statement, which outputs the line of text ___)

    .1 A
    B .2
    C .3
    D .4
    E .5
    I selected is D, the answer is B. Parsing: \ t is a tab, non-breaking space is eight. \ n is a newline.
  • Of the following types, which one can not store a numeric value? (In the following data types, which can not store a data type value?)

    A .int

    B .byte

    C .float

    D .char

    E .all of these can store numeric values ​​(all of the above types can store numerical data)

    The answer is D, I chose E. Analysis: storage and storage of digital characters is not the same. For example: 602, this figure is a calculation can be done, but if it is "602ABC" are, respectively, a 6,0,2 characters, and other characters as a string.
  • A cast is required in which of the following situations? (Which of the following need to cast?)

    A .using charAt to take an element of a String and store it in a char (charAt used to obtain the string elements and stored as a char type)

    B .storing an int in a float (int type to a number storage type float)

    C .storing a float in a double (a float type number stored as double type)

    D .storing a float in an int (a float type number storage type int)

    E .all of the above require casts (All of the above are required cast)

    The answer is D, I chose B. Analysis: small large-scale unrestricted; Dahua small should be compulsory; Dahua small, most of the small can force

  • If x is an int and y is a float, all of the following are legal except which assignment statement? (If x is an int, y is the number of a float, all of the following assignment statement which is not lawful?)

    A y = x;

    B .x = y;

    C .y = (float) x;

    D .x = (int) y;

    E .all of the above are legal (above all legal)

    The answer is B, I chose C. Analysis: Last question and the same.
  • What is output with the statement System.out.println (x + y);? If x and y are int values ​​where x = 10 and y = 5 (if x and y is a number of type int, x = 10, y = 5, the statement System.out.println (x + y); What is the output)?

    A .15

    B .105

    C .10 5

    D .x+y

    E .An error since neither x nor y is a String (an error due to the x and y strings are not caused)

    The answer is A, I chose C. Analysis: output is the value of the equation 10 + 5.
  • An API is

    A .an Abstract Programming Interface

    B .an Application Programmer's Interface

    C .an Application Programming Interface

    D .an Abstract Programmer's Interface

    E .an Absolute Programming Interface

    The answer is C, I chose A. Analysis: An API is a set of application programming interfaces related to the class of purpose-built. They usually reside in a class library.
  • Consider the following enumerationenum Speed { FAST, MEDIUM, SLOW };

    A .The ordinal value of MEDIUM is 2

    B .The ordinal value of SLOW is 1

    C .The name of the Speed enumeration whose ordinal value is zero is FAST

    D .The name of the Speed enumeration whose ordinal value is one is SLOW

    E .None of the above

    The answer is C, I chose D. Analysis: enumeration has a value of zero order of the start, in ascending order from left to right. So, Speed.FAST. Sequence Number () is 0, Speed.MEDIUM. Sequence Number () is 1, Speed.SLOW. Sequence Number () 2.
  • System.out.println("123" + 4) will display the value 127.

    A .true

    B .false

    The answer is B, I chose A. Analysis: "123" is a string. Therefore, the lead string concatenation +. 4 will be converted into the string "4", and 1234 will be created and displayed character string.
    -All the methods in the Math class are declared to be static.

    A .true

    B .false

    The answer is A, I chose B. Analysis: Maths methods generally designed for an arithmetic expression, there is no need to use any instance. This is done by ensuring that all of the mathematical method is static.
    -These two ways of setting up a String yield identical results:

    a) String string = new String("123.45");

    b) String string = "" + 123.45;

    A .true

    B .false

    The answer is A, I chose B. Analytical: Java + appreciated that when the number of strings in combination of operator and means should be converted to a digital numeric string, then connection should occur.

Pair peer review and

  • Based on score, I give this blog scoring: 22 points. Scores are as follows:
  1. Proper use Markdown syntax (1 point):
  2. Elements range (1 point) template
  3. Textbook learning and problem-solving process (plus 12 points)
  4. Other plus points (8 points):
    • 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
    • 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
    • Of test questions conscientiously sum up 2 points

      Comments had students blog and code

  • Pair this week learning
    • 20182318
    • Pair learning content
      • Some discussion of the use and role of classes and packages.
      • Problems arising in the course of writing code to solve mutual discussion.
      • To discuss how the book written questions after class.

Other (perception, thinking, etc., optional)

  • This week is the second and third weeks of learning tasks merged together, the task a bit heavy, but in the end basically completed, congratulations! ! !
  • About the exam, I feel I am too hard. I'm still not enough to understand the book, for a concept can not understand the depths, then for moderation, this careless mistake, great harm. The most important is that teachers are now out of the test questions in English, which is very painful for me, my English is bad, they wanted to strengthen the learning of English.
  • Learning content in the book, I think Liezi and back exercises in the book is very important, a more thorough knowledge point after they are written again be associated with understanding. In short, to knock the code more practice, this will be a more profound grasp of the grammar and the like.

    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 56/56 2/2 20/20 The main learned simple operation Linux and how to write a simple java program code and upload it to the cloud
the second week 331/407 3/5 23/43 I learned some classes and packages, but also understand the difference between Java and C language in some places
  • Plan study time: 20 hours
  • The actual study time: 23 hours
  • To improve the situation: First, the code has improved significantly last week than many, but still a little small. Learning time is increased.

Reference material

Guess you like

Origin www.cnblogs.com/qianjiayu/p/11569173.html