20165223 Java programming Sixth week of study summary

Source: Internet
Author: User

Summary of the contents of learning materials Eighth-common practical categories-key points
    • Base: String class
    • Focus:StringTokenizer class ,scanner class
    • Difficulties: Classand Console classes ,pattern classes and Match classes
    • Other Special classes: StringBuffer class, Date class and Calendar class, dates formatting, math class, BigInteger class, Random class, numeric formatting
15th-generics and collective framework-essentials
    • Generic type
    • Linked list
    • Stack
    • Hash map
    • Tree Set
    • Tree mapping
Problems in teaching materials learning and the solving process
  • String class
    • In the Java.lang package, the default introduction
    • is defined as the final class, cannot be extended, no sub-class
  • Constructs a String object
    • String Object = String Object
      • Constant object: Constant pool
      • String object: Extraordinary Pool
        • String, new class declaration
        • Cannot output a reference to a string object, only the entity of the object
        • You can create another string object with a string object that you have created
      • Common construction methods
        • String (char a[])
        • String (Char a[], int startIndex, int count)//selected array, starting position, fetch quantity
      • Referencing string constants
        • You can assign a reference to a string constant to a string object (constant pool → extraordinary pool) with the same reference → have the same entity
  • String collocated: "+", a new string object connected to the end
    • Two constant Resets → constants
    • One of them is a variable/variable → a new string object entity and reference in the dynamic storage area (the very pool)
    • Entities that attach more importance to two string objects
  • Common methods of the string class
    • public int Length (): Gets the character sequence length
    • public boolean equals (String s): A sequence of characters
    • public Boolean startsWith (String s): Judge prefix
    • public Boolean endsWith (String s): judging suffix
    • public int CompareTo (String s): Compares character sequence sizes by dictionary order, =S returns 0,>s returns positive values, <S returns negative values
    • Public Boolean contains (String s): Determines whether the current character sequence contains the character sequence of the parameter s
    • public int indexOf (String s): Retrieves the position of the first occurrence of the character sequence of STR, starting at the 0 index position of the current sequence, and returns the position; 1 if none
    • public int lastIndexOf (String s): Retrieves the position of the last occurrence of the character sequence of STR, starting at the 0 index position of the current sequence, and returns the position; 1 if none
    • Public String substring (int startpoint): Copies the sequence of characters obtained from the startpoint position to the last position
    • substring (int start,int end): Copies the sequence of characters from the start position to the end-1 position
    • Public String trim (): The sequence of characters after the trailing space is removed
  • The string representation of the object: ToString ()
  • string and character array, byte array: GetChar ()
  • The substitution and decomposition of regular expressions and strings
Problems in code debugging and the resolution process
    • Q1: In Example8_4.java, did you find the result sum=0 after running?

Answer: The parameters of the main method have not been used before, args[] can accept the user input character sequence from the keyboard, need to use Java.exe to execute the main class, add the reference to get the sum value, otherwise is the initial 0.0

    • Q2: In Example8_7.java, there is garbled after running.

Answer: Idea problem, Chinese garbled, according to Baidu experience solved the problem

    • Q3: In Example8_9.java, the code does not work?

Answer: Do not import java.util.Scanner, and conflicts with other classes, corrected successfully

    • Q4:
Thinking and feeling

This week's two chapters are not particularly difficult, listening to the net lesson of the teacher explained already very clear, most only need to understand the mastery can, just need to grasp the difficulty on the line. The main learning of the Java function Library of various functions, convenient to write code after the call, save time, concise code.

Code Hosting

See blog: https://gitee.com/BESTI-IS-JAVA-2018/20165223cn.git

Learning progress Bar
lines of code (new/cumulative) Blog Volume (Add/accumulate) Learning Time (new/cumulative) Important Growth
Goal 3000 rows 30 Articles 400 hours
Week Six 1324/200 2/11 20/20 Depth
Resources
    1. Instructional Videos
    2. Debugging Java programs with JDB

20165223 Java programming Sixth week of study summary

Related Article

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.