20145311 Java programming Eighth week of study summary

Source: Internet
Author: User
Tags character classes locale

20145311 "Java Programming" Seventh Week study summary textbook study content summary 14th NiO and NIO2

Advanced input and output processing, can use NIO (New IO), NIO2 is the file system API

15th Chapter General API15.1 Log
15.1.1 Log API

The starting point for using the log is the Logger class, to obtain the Logger class, you must use Logger's static method GetLogger (), and the Logger.log () method can be used to output information. The default logger also records the time, class, method and other information, logger is the starting point for recording information, but also through some filtering to output information, output information is actually responsible for handler .
Logger has a hierarchical relationship, each logger after processing their own log actions, recalling the parent logger propagation, so that the parent logger can also process the log

15.1.2 specifying the log level

Logger instance output is hierarchical and level.all is used to allow all information output

15.1.3Handler and Formatter

Memoryhandler does not format the log information, the information is staged in the memory buffer, knowing that the buffer size is exceeded before the information is output to the specified target handler
If you do not want the handler of the parent logger to process the log, you can call Setuseparenthandlers () of the logger instance to False

15.1.4 customizing Handler, formatter, and filter

Formatting is the responsibility of the formatter, the filter is responsible for the filtering

15.1.5logging.properties

The logger configuration can be configured by logging.properties so that the configuration can be modified without using the program

15.2 Internationalization (internationalization)
15.2.1ResourceBundle

ResourceBundle can be used to do information binding, moving information that might change later to the program: the properties document must be placed in the path setting of the Classpath

15.2.2Locale

The corresponding class of locale information is locale, which can be specified by language encoding and locale code when establishing locale instance.

15.3 Regular Expressions (Regular expression)
15.3.1

The split method of string accepts a regular expression, and the rule expression Basic mountain consists of two characters: literal meaning characters (literals) and metacharacters (metacharacters), metacharacters have special meanings in regular expressions, and to compare these characters must be omitted. In Java, to compose a rule representation in "" is different from the direct write rule expression, which generally needs to be prefixed with a \ symbol.
Multiple characters are grouped together to be a character class placed in [], some commonly used character classes do not have to be placed in [], to become a predefined character class, character classes need to use the multi-query API
See greedy quantifiers, the comparator will be the remainder of the text eaten, and then gradually spit out, the result is greedy quantifiers will try to find the longest length of the text in the greedy quantifier after adding? will become a gradual quantifier, the gradual quantifier will be as far as possible to find the shortest length of the matching text
After greedy quantifiers Plus + will become a degree of spit quantifiers, comparator saw the word will first eat the remaining words, and then see if the words of the single-spit measure is in line with the text to eat, if met will not spit out
ReplaceAll will replace the string that matches the rule expression and return the new string
\b can be used to mark boundary boundary comparisons to indicate that the text must conform to a specified boundary condition, that is, an anchor point, or that it can be called an anchored point (Anchor) to group the rule representation, and to use a quantifier

15.3.2Pattern and Matcher

Pattern instances must be obtained through the static method compile of the pattern
After you get the pattern instance, you can use the split () method to cut the specified string, similar to the split () method of String, Matcher also has the ReplaceAll () method, similar to the ReplaceAll () method of String

15.4jdk8api new features 15.4.1StringJoiner Arrarys

The join method of string can be used to concatenate strings, and the arrays class also adds some overloaded methods

15.4.2Stream

The range method of stream can produce an integer range, and the Java.util.Random class can be used to generate random numbers

Problems in teaching materials learning and the solving process

After class selection ch15:b AB ABC D A

Problems in code debugging and the resolution process

Other (sentiment, thinking, etc., optional)

This week is mainly to learn some common API, the internationalization of some knowledge, and then there is the regular expression and jdk8 new features, after all, these weeks are around the Java commonly used in some classes and interfaces, methods of use, or should be the use of these classes in the actual example of a lot of attempts, To really master the details of the use of these classes and their respective roles.

Learning progress Bar
Lines of code (new/cumulative Blog volume (cumulative/target) Study time Estimating Learning Time Actual learning Time Important growth
Goal 5000 rows 30 Articles 400 hours
First week 150/150 2/2 15
Second week 500/650 3/4 15
Third week 500/1150 4/5 14

Week Four 600/1750 5/6 15
Week Five 500/2250 6/7 9 I didn't learn much this week.
Week Six 300/2350 7/8 10 Learning is still untrue, but better than last week
Seventh Week

300/2650

This week wrote about 300 lines of code (including experiments),

Some of the code is directly pasted run and look at the results

10/10

8h~9h

20K

8h~9h

This week's study content is mainly the time, the date correlation class application,

Compared to the previous chapters, it's a bit simpler,

The actual learning time is less than the estimated learning time,

The time spent reading is about the same as the estimate,

But write code, debug, do practical application,

Learning Java experiments related debugging skills, testing skills time or less, or a little lazy.

Eighth Week

400/3050

12/12

8h

9h

8h

Java is behind the use of classes, not the actual operation is certainly not allowed, hands or less,

On paper, you should take the initiative to knock more code.

Resources
    • Java Learning Notes (8th Edition)
    • Java Learning Note (8th Edition) Learning Guide
    • ...

20145311 Java programming Eighth week of study summary

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.