Java BASICS (13) Summary of common classes (3) and java Basics

Source: Internet
Author: User

Java BASICS (13) Summary of common classes (3) and java Basics

Here are some of the knowledge points and code I summarized in my previous class. Most of the notes I think are very good and classic, sincerely hope that these will help those who want to learn!

It is inconvenient to upload code by module. There are also many things, and they are also clear! If you need it, you can leave your email in the comments. I will certainly send it to you for free! Thank you for making progress on this platform !! Remember that programmers are selfless !!!

Also very welcome to my blog to watch blog address: http://www.cnblogs.com/duscl/

 

/* 1: Regular Expression (comprehension) (1) is A string that complies with certain rules (2) Common Rule A: character x. For example, 'A' indicates the character a \ backslash. \ N New Line (line feed) character ('\ u000a') \ r carriage return character (' \ u000d') B: character class [abc] a, B, or c (simple class) [^ abc] any character except a, B, or c (negative) [a-zA-Z] a to z or A to Z. The two letters are included in the range) [0-9] characters ranging from 0 to 9 contain C: pre-defined character classes. any character. My character is the. character itself. How do I represent it? \. \ D Number: [0-9] \ w word character: [a-zA-Z_0-9] What makes up a word in a regular expression must have these things make up D: the boundary is the start of the line. $ the end of the line \ B the word boundary is not a word character. Example: hello world? Haha; xixi E: Greedy quantizer X? X, once or once does not have X * X, zero or multiple times X + X, once or multiple times X {n} X, EXACTLY n times X {n,} X, at least n times X {n, m} X, at least n times, but not more than m times (3) common features: (who are they using ?) A: public boolean matches (String regex) B: split public String [] split (String regex) C: public String replaceAll (String regex, String replacement) D: Obtain the Pattern Function and Matcher Pattern p = Pattern. compile ("a * B"); Matcher m = p. matcher ("aaaaab"); find (): find the group that does not exist (): Get the data you just searched for (4) Case A: Determine the phone number and email address B: split data according to different rules C: replace the number in the forum with * D: Get the Three-character word in the string 2: Math (master) (1) class (2) common methods for mathematical operations (Complete by yourself) A: absolute value B: rounded up C: rounded down D: Round E: B power of a in the two data F: random number G: Rounding H: positive square root (3) case: A: Guess number game B: Get Random numbers in any range 3: Random (understanding) (1) class used to generate Random numbers (2) constructor:: random () default seed. the Random number generated each time is different. B: Random (long seed) specifies the seed. the Random number is the same for each seed. (3) member Method: A: int nextInt () returns the random number B in the int range: int nextInt (int n) returns the random number in the range of [0, n) 4: System (master) (1) System class, some useful fields and methods are provided. (2) member methods (completed by yourself) A: run the Garbage Collector B: Exit jvm C: Get the millisecond value of the current time D: copy the array 5: bigInteger (comprehension) (1) Calculation of large integers (2) constructor A: BigInte Ger (String s) (3) member method (complete by yourself) A: Add B: Subtract C: multiply D: Divide E: quotient and remainder 6: BigDecimal (understanding) (1) when floating point data is computed, the precision is lost. Therefore, BigDecimal is recommended for floating point data operations. (Financial related project) (2) constructor A: BigDecimal (String s) (3) member Method: A: Add B: Subtract C: multiply D: Divide E: keep decimal digits by yourself. 7: Date/DateFormat (master) (1) Date is a Date class and can be accurate to milliseconds. A: constructor Date () Date (long time) B: Member method getTime () setTime (long time) C: mutual conversion of Date and millisecond values case: how many days have you been in this world? (2) The DateFormat class for formatting the date and parsing the String, but it is an abstract class, so use its subclass SimpleDateFormat A: SimpleDateFormat (String pattern) conversion of the given mode yyyy-MM-dd HH: mm: ss B: Date and String a: Date -- String format () B: String -- Date parse () C: case: A tool class for date operations is created. 8: Calendar (master) (1) Calendar class, which encapsulates all Calendar Field Values. You can obtain values by entering different Calendar fields in a unified way. (2) How To Get A Calendar Object? Calendar rightNow = Calendar. getInstance (); essentially returns the subclass object (3) member method A: obtain the corresponding value B Based on the calendar field: based on the calendar field and a positive number, determine whether to add or subtract the value of the corresponding calendar field C: Set the year, month, and day of the Calendar Object (4) Case: How many days are there in February of any year? *\

 

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.